mirror of
https://github.com/github/codeql-action.git
synced 2025-12-25 16:50:21 +08:00
Compare commits
162 Commits
codeql-bun
...
v2.25.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceaec5c11a | ||
|
|
39f10b5b8a | ||
|
|
64ccee938f | ||
|
|
e76c3643d1 | ||
|
|
caa31633f2 | ||
|
|
04aff1f5fa | ||
|
|
d39d31e687 | ||
|
|
a7278252c7 | ||
|
|
1efa8597b1 | ||
|
|
ac2f82a1ff | ||
|
|
0ad7791640 | ||
|
|
79d9ee7f07 | ||
|
|
9ace329d8c | ||
|
|
dbf2b1706b | ||
|
|
b849f33370 | ||
|
|
ff6a3c42a5 | ||
|
|
42cbd34070 | ||
|
|
9762ef1fad | ||
|
|
5122fa879d | ||
|
|
c3aa7b8d0d | ||
|
|
619dc0c4b8 | ||
|
|
8f596b4ae3 | ||
|
|
de8916ec5a | ||
|
|
4909c1ffb9 | ||
|
|
f45390cde1 | ||
|
|
1be8c488eb | ||
|
|
82edfe29ce | ||
|
|
8786e1f9a1 | ||
|
|
e949a1676c | ||
|
|
3c7ac61481 | ||
|
|
948c1ebff4 | ||
|
|
e4b5f9d015 | ||
|
|
8aad228360 | ||
|
|
c992dad089 | ||
|
|
06c30cc68c | ||
|
|
b5bd9be6da | ||
|
|
c7f9125735 | ||
|
|
1c7e8b2cf2 | ||
|
|
39e1e6509e | ||
|
|
501f5f5716 | ||
|
|
5d73b1bd71 | ||
|
|
f72882a05b | ||
|
|
b9d792527d | ||
|
|
12bc863d11 | ||
|
|
ba352fa8e7 | ||
|
|
d95215f691 | ||
|
|
553a89d488 | ||
|
|
ffd3158cb9 | ||
|
|
82478fb458 | ||
|
|
2a96432c79 | ||
|
|
93075ceec3 | ||
|
|
a023017ea9 | ||
|
|
794eacf375 | ||
|
|
a1559aa4a9 | ||
|
|
a82bad7182 | ||
|
|
61ddd48e03 | ||
|
|
abca38cf8c | ||
|
|
763babe7ac | ||
|
|
72d46cb780 | ||
|
|
0b21c947c0 | ||
|
|
c2dc67199a | ||
|
|
f018a9586e | ||
|
|
6007966519 | ||
|
|
efed72eb8f | ||
|
|
bcca54f232 | ||
|
|
76d48637f2 | ||
|
|
4821ae1424 | ||
|
|
e56cfd0877 | ||
|
|
6046c633c7 | ||
|
|
ed2b6b741f | ||
|
|
570dc010e8 | ||
|
|
1a8046c7f3 | ||
|
|
8c395e0c45 | ||
|
|
de22b302a6 | ||
|
|
928ff8c822 | ||
|
|
2f52385615 | ||
|
|
272cd56763 | ||
|
|
3839e215cc | ||
|
|
61f4d893e6 | ||
|
|
30ad6c3d9e | ||
|
|
78df51c1cc | ||
|
|
045d9f3939 | ||
|
|
a3c8eb3ab0 | ||
|
|
6078595fdf | ||
|
|
395cdfe20c | ||
|
|
a56a03b370 | ||
|
|
05053827ef | ||
|
|
fa5685c7f0 | ||
|
|
8c3591c19a | ||
|
|
557a8d2306 | ||
|
|
7351df07bb | ||
|
|
d15fdd879b | ||
|
|
80eb8d5395 | ||
|
|
0ddabac401 | ||
|
|
b882b63a68 | ||
|
|
8b0f3e6135 | ||
|
|
8601b9e70a | ||
|
|
bd94b4c175 | ||
|
|
755340a6bd | ||
|
|
4a8f20f6b9 | ||
|
|
460939e7d8 | ||
|
|
ceebdeb9fa | ||
|
|
47c8d615ed | ||
|
|
c232c5de9c | ||
|
|
2452b7d8af | ||
|
|
4ffed09d48 | ||
|
|
8b6a45a6ec | ||
|
|
2ccdcd5135 | ||
|
|
4f50fb3be5 | ||
|
|
02022337ac | ||
|
|
3dafabe4d9 | ||
|
|
40cd785140 | ||
|
|
10746dd61e | ||
|
|
1a077f8f6c | ||
|
|
05d809f630 | ||
|
|
d8c4c3a4eb | ||
|
|
b301568384 | ||
|
|
f5c8be0ac1 | ||
|
|
4504810aa1 | ||
|
|
dc021d495c | ||
|
|
f822fa3067 | ||
|
|
3ed798ed18 | ||
|
|
5b498ba405 | ||
|
|
7dde705407 | ||
|
|
c004a3e831 | ||
|
|
2f93e4319b | ||
|
|
c98f2c953c | ||
|
|
554c990fe8 | ||
|
|
abe5934e80 | ||
|
|
8879ae88d9 | ||
|
|
01e8d7f881 | ||
|
|
4759df8df7 | ||
|
|
554005d264 | ||
|
|
fb29452d38 | ||
|
|
13884cb7d7 | ||
|
|
ac64986f93 | ||
|
|
cdcacf8b4f | ||
|
|
8b7fcbfac2 | ||
|
|
e24bd8fed4 | ||
|
|
8f2682add5 | ||
|
|
8f5ae1a11a | ||
|
|
99d337aef5 | ||
|
|
997d889b5d | ||
|
|
1500a13138 | ||
|
|
0d318c9f1a | ||
|
|
d6286c6fdb | ||
|
|
9c74de20cb | ||
|
|
49a6ae4966 | ||
|
|
3366e3bbdd | ||
|
|
844fc3cd56 | ||
|
|
5a201efe22 | ||
|
|
c9f92aa25f | ||
|
|
03e7845b7b | ||
|
|
54f10077ea | ||
|
|
20d1a9b175 | ||
|
|
c28d79bb2e | ||
|
|
241e8b42b2 | ||
|
|
8bc67d15e2 | ||
|
|
e106171cbb | ||
|
|
231f9f1b59 | ||
|
|
47334bf4e9 | ||
|
|
e763762131 |
2
.github/actions/check-sarif/action.yml
vendored
2
.github/actions/check-sarif/action.yml
vendored
@@ -16,5 +16,5 @@ inputs:
|
|||||||
Comma separated list of query ids that should NOT be included in this SARIF file.
|
Comma separated list of query ids that should NOT be included in this SARIF file.
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: index.js
|
main: index.js
|
||||||
|
|||||||
2
.github/workflows/__all-platform-bundle.yml
generated
vendored
2
.github/workflows/__all-platform-bundle.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__analyze-ref-input.yml
generated
vendored
2
.github/workflows/__analyze-ref-input.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__autobuild-action.yml
generated
vendored
2
.github/workflows/__autobuild-action.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__autobuild-direct-tracing.yml
generated
vendored
2
.github/workflows/__autobuild-direct-tracing.yml
generated
vendored
@@ -45,7 +45,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__build-mode-autobuild.yml
generated
vendored
2
.github/workflows/__build-mode-autobuild.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__build-mode-manual.yml
generated
vendored
2
.github/workflows/__build-mode-manual.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__build-mode-none.yml
generated
vendored
2
.github/workflows/__build-mode-none.yml
generated
vendored
@@ -41,7 +41,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__build-mode-rollback.yml
generated
vendored
2
.github/workflows/__build-mode-rollback.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__config-export.yml
generated
vendored
2
.github/workflows/__config-export.yml
generated
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__config-input.yml
generated
vendored
2
.github/workflows/__config-input.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__cpp-deptrace-disabled.yml
generated
vendored
2
.github/workflows/__cpp-deptrace-disabled.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__cpp-deptrace-enabled-on-macos.yml
generated
vendored
2
.github/workflows/__cpp-deptrace-enabled-on-macos.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__cpp-deptrace-enabled.yml
generated
vendored
2
.github/workflows/__cpp-deptrace-enabled.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/__diagnostics-export.yml
generated
vendored
4
.github/workflows/__diagnostics-export.yml
generated
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__extractor-ram-threads.yml
generated
vendored
2
.github/workflows/__extractor-ram-threads.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
11
.github/workflows/__go-custom-queries.yml
generated
vendored
11
.github/workflows/__go-custom-queries.yml
generated
vendored
@@ -29,19 +29,19 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
@@ -102,6 +102,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
use-all-platform-bundle: 'false'
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '>=1.21.0'
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
with:
|
with:
|
||||||
languages: go
|
languages: go
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
8
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
@@ -29,15 +29,15 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
8
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
@@ -29,15 +29,15 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
8
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
@@ -29,15 +29,15 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__init-with-registries.yml
generated
vendored
2
.github/workflows/__init-with-registries.yml
generated
vendored
@@ -56,7 +56,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__javascript-source-root.yml
generated
vendored
2
.github/workflows/__javascript-source-root.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__language-aliases.yml
generated
vendored
2
.github/workflows/__language-aliases.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/__multi-language-autodetect.yml
generated
vendored
12
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -29,15 +29,15 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
@@ -86,6 +86,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
use-all-platform-bundle: 'false'
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '>=1.21.0'
|
||||||
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
id: init
|
id: init
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
2
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
2
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__packaging-config-js.yml
generated
vendored
2
.github/workflows/__packaging-config-js.yml
generated
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__packaging-inputs-js.yml
generated
vendored
2
.github/workflows/__packaging-inputs-js.yml
generated
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/__remote-config.yml
generated
vendored
8
.github/workflows/__remote-config.yml
generated
vendored
@@ -29,19 +29,19 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/__resolve-environment-action.yml
generated
vendored
4
.github/workflows/__resolve-environment-action.yml
generated
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.4
|
version: stable-v2.13.4
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.4
|
version: stable-v2.13.4
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: stable-v2.13.4
|
version: stable-v2.13.4
|
||||||
@@ -61,7 +61,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__rubocop-multi-language.yml
generated
vendored
2
.github/workflows/__rubocop-multi-language.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__ruby.yml
generated
vendored
2
.github/workflows/__ruby.yml
generated
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
12
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
@@ -29,15 +29,15 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-20230403
|
version: stable-20230403
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.13.5
|
version: stable-v2.13.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: macos-latest
|
- os: macos-12
|
||||||
version: stable-v2.14.6
|
version: stable-v2.14.6
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
@@ -86,6 +86,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
use-all-platform-bundle: 'false'
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '>=1.21.0'
|
||||||
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
id: init
|
id: init
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/__split-workflow.yml
generated
vendored
2
.github/workflows/__split-workflow.yml
generated
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__submit-sarif-failure.yml
generated
vendored
2
.github/workflows/__submit-sarif-failure.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__swift-custom-build.yml
generated
vendored
2
.github/workflows/__swift-custom-build.yml
generated
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
2
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__test-local-codeql.yml
generated
vendored
2
.github/workflows/__test-local-codeql.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__test-proxy.yml
generated
vendored
2
.github/workflows/__test-proxy.yml
generated
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__unset-environment.yml
generated
vendored
2
.github/workflows/__unset-environment.yml
generated
vendored
@@ -53,7 +53,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
2
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/__with-checkout-path.yml
generated
vendored
2
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Setup Python on MacOS
|
- name: Setup Python on MacOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: >-
|
if: >-
|
||||||
matrix.os == 'macos-latest' && (
|
runner.os == 'macOS' && (
|
||||||
|
|
||||||
matrix.version == 'stable-20230403' ||
|
matrix.version == 'stable-20230403' ||
|
||||||
|
|
||||||
|
|||||||
3
.github/workflows/pr-checks.yml
vendored
3
.github/workflows/pr-checks.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-types-version: [16.11, current] # run tests on 16.11 while CodeQL Action v2 is still supported
|
node-types-version: [16.11, current] # we backport this matrix job in order to maintain the same check names
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -49,6 +49,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check generated JS
|
- name: Check generated JS
|
||||||
|
if: matrix.node-types-version != 'current' # we do not need to test the newer node on the v2 branch
|
||||||
run: .github/workflows/script/check-js.sh
|
run: .github/workflows/script/check-js.sh
|
||||||
|
|
||||||
check-node-modules:
|
check-node-modules:
|
||||||
|
|||||||
50
CHANGELOG.md
50
CHANGELOG.md
@@ -4,95 +4,101 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
|||||||
|
|
||||||
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
||||||
|
|
||||||
## [UNRELEASED]
|
## 2.25.3 - 25 Apr 2024
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.17.1. [#2247](https://github.com/github/codeql-action/pull/2247)
|
||||||
|
- Workflows running on `macos-latest` using CodeQL CLI versions before v2.15.1 will need to either upgrade their CLI version to v2.15.1 or newer, or change the platform to an Intel MacOS runner, such as `macos-12`. ARM machines with SIP disabled, including the newest `macos-latest` image, are unsupported for CLI versions before 2.15.1. [#2261](https://github.com/github/codeql-action/pull/2261)
|
||||||
|
|
||||||
|
## 2.25.2 - 22 Apr 2024
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 2.25.1 - 17 Apr 2024
|
||||||
|
|
||||||
- We are rolling out a feature in April/May 2024 that improves the reliability and performance of analyzing code when analyzing a compiled language with the `autobuild` [build mode](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes). [#2235](https://github.com/github/codeql-action/pull/2235)
|
- We are rolling out a feature in April/May 2024 that improves the reliability and performance of analyzing code when analyzing a compiled language with the `autobuild` [build mode](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes). [#2235](https://github.com/github/codeql-action/pull/2235)
|
||||||
- Fix a bug where the `init` Action would fail if `--overwrite` was specified in `CODEQL_ACTION_EXTRA_OPTIONS`. [#2245](https://github.com/github/codeql-action/pull/2245)
|
- Fix a bug where the `init` Action would fail if `--overwrite` was specified in `CODEQL_ACTION_EXTRA_OPTIONS`. [#2245](https://github.com/github/codeql-action/pull/2245)
|
||||||
|
|
||||||
## 3.25.0 - 15 Apr 2024
|
## 2.25.0 - 15 Apr 2024
|
||||||
|
|
||||||
- The deprecated feature for extracting dependencies for a Python analysis has been removed. [#2224](https://github.com/github/codeql-action/pull/2224)
|
- The deprecated feature for extracting dependencies for a Python analysis has been removed. [#2224](https://github.com/github/codeql-action/pull/2224)
|
||||||
|
|
||||||
As a result, the following inputs and environment variables are now ignored:
|
As a result, the following inputs and environment variables are now ignored:
|
||||||
|
|
||||||
- The `setup-python-dependencies` input to the `init` Action
|
- The `setup-python-dependencies` input to the `init` Action
|
||||||
- The `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION` environment variable
|
- The `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION` environment variable
|
||||||
|
|
||||||
We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0.
|
We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0.
|
||||||
- Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229)
|
- Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229)
|
||||||
- Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232)
|
- Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232)
|
||||||
- A more relevant log message and a diagnostic are now emitted when the `file` program is not installed on a Linux runner, but is required for Go tracing to succeed. [#2234](https://github.com/github/codeql-action/pull/2234)
|
- A more relevant log message and a diagnostic are now emitted when the `file` program is not installed on a Linux runner, but is required for Go tracing to succeed. [#2234](https://github.com/github/codeql-action/pull/2234)
|
||||||
|
|
||||||
## 3.24.10 - 05 Apr 2024
|
## 2.24.10 - 05 Apr 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.17.0. [#2219](https://github.com/github/codeql-action/pull/2219)
|
- Update default CodeQL bundle version to 2.17.0. [#2219](https://github.com/github/codeql-action/pull/2219)
|
||||||
- Add a deprecation warning for customers using CodeQL version 2.12.5 and earlier. These versions of CodeQL were discontinued on 26 March 2024 alongside GitHub Enterprise Server 3.8, and will be unsupported by CodeQL Action versions 3.25.0 and later and versions 2.25.0 and later. [#2220](https://github.com/github/codeql-action/pull/2220)
|
- Add a deprecation warning for customers using CodeQL version 2.12.5 and earlier. These versions of CodeQL were discontinued on 26 March 2024 alongside GitHub Enterprise Server 3.8, and will be unsupported by CodeQL Action versions 3.25.0 and later and versions 2.25.0 and later. [#2220](https://github.com/github/codeql-action/pull/2220)
|
||||||
- If you are using one of these versions, please update to CodeQL CLI version 2.12.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version.
|
- If you are using one of these versions, please update to CodeQL CLI version 2.12.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version.
|
||||||
- Alternatively, if you want to continue using a version of the CodeQL CLI between 2.11.6 and 2.12.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.24.10` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.24.10` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
- Alternatively, if you want to continue using a version of the CodeQL CLI between 2.11.6 and 2.12.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.24.10` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.24.10` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
|
||||||
|
|
||||||
## 3.24.9 - 22 Mar 2024
|
## 2.24.9 - 22 Mar 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203)
|
- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203)
|
||||||
|
|
||||||
## 3.24.8 - 18 Mar 2024
|
## 2.24.8 - 18 Mar 2024
|
||||||
|
|
||||||
- Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. [#2195](https://github.com/github/codeql-action/pull/2195)
|
- Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. [#2195](https://github.com/github/codeql-action/pull/2195)
|
||||||
|
|
||||||
## 3.24.7 - 12 Mar 2024
|
## 2.24.7 - 12 Mar 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185)
|
- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185)
|
||||||
|
|
||||||
## 3.24.6 - 29 Feb 2024
|
## 2.24.6 - 29 Feb 2024
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
## 3.24.5 - 23 Feb 2024
|
## 2.24.5 - 23 Feb 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156)
|
- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156)
|
||||||
|
|
||||||
## 3.24.4 - 21 Feb 2024
|
## 2.24.4 - 21 Feb 2024
|
||||||
|
|
||||||
- Fix an issue where an existing, but empty, `/sys/fs/cgroup/cpuset.cpus` file always resulted in a single-threaded run. [#2151](https://github.com/github/codeql-action/pull/2151)
|
- Fix an issue where an existing, but empty, `/sys/fs/cgroup/cpuset.cpus` file always resulted in a single-threaded run. [#2151](https://github.com/github/codeql-action/pull/2151)
|
||||||
|
|
||||||
## 3.24.3 - 15 Feb 2024
|
## 2.24.3 - 15 Feb 2024
|
||||||
|
|
||||||
- Fix an issue where the CodeQL Action would fail to load a configuration specified by the `config` input to the `init` Action. [#2147](https://github.com/github/codeql-action/pull/2147)
|
- Fix an issue where the CodeQL Action would fail to load a configuration specified by the `config` input to the `init` Action. [#2147](https://github.com/github/codeql-action/pull/2147)
|
||||||
|
|
||||||
## 3.24.2 - 15 Feb 2024
|
## 2.24.2 - 15 Feb 2024
|
||||||
|
|
||||||
- Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141)
|
- Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141)
|
||||||
|
|
||||||
## 3.24.1 - 13 Feb 2024
|
## 2.24.1 - 13 Feb 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124)
|
- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124)
|
||||||
- The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121)
|
- The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121)
|
||||||
|
|
||||||
## 3.24.0 - 02 Feb 2024
|
## 2.24.0 - 02 Feb 2024
|
||||||
|
|
||||||
- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106)
|
- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106)
|
||||||
|
|
||||||
## 3.23.2 - 26 Jan 2024
|
## 2.23.2 - 26 Jan 2024
|
||||||
|
|
||||||
- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083)
|
- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083)
|
||||||
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)
|
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)
|
||||||
|
|
||||||
## 3.23.1 - 17 Jan 2024
|
## 2.23.1 - 17 Jan 2024
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073)
|
- Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073)
|
||||||
- Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079)
|
- Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079)
|
||||||
|
|
||||||
## 3.23.0 - 08 Jan 2024
|
## 2.23.0 - 08 Jan 2024
|
||||||
|
|
||||||
- We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false` in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. [#2031](https://github.com/github/codeql-action/pull/2031)
|
- We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false` in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. [#2031](https://github.com/github/codeql-action/pull/2031)
|
||||||
- The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see [the corresponding changelog entry for CodeQL Action version 2.22.7](#2227---16-nov-2023). [#2009](https://github.com/github/codeql-action/pull/2009)
|
- The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see [the corresponding changelog entry for CodeQL Action version 2.22.7](#2227---16-nov-2023). [#2009](https://github.com/github/codeql-action/pull/2009)
|
||||||
|
|
||||||
## 3.22.12 - 22 Dec 2023
|
## 2.22.12 - 22 Dec 2023
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047)
|
- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047)
|
||||||
|
|
||||||
## 3.22.11 - 13 Dec 2023
|
## 2.22.11 - 13 Dec 2023
|
||||||
|
|
||||||
- [v3+ only] The CodeQL Action now runs on Node.js v20. [#2006](https://github.com/github/codeql-action/pull/2006)
|
No user facing changes.
|
||||||
|
|
||||||
## 2.22.10 - 12 Dec 2023
|
## 2.22.10 - 12 Dec 2023
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,6 @@ outputs:
|
|||||||
sarif-id:
|
sarif-id:
|
||||||
description: The ID of the uploaded SARIF file.
|
description: The ID of the uploaded SARIF file.
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: "../lib/analyze-action.js"
|
main: "../lib/analyze-action.js"
|
||||||
post: "../lib/analyze-action-post.js"
|
post: "../lib/analyze-action-post.js"
|
||||||
|
|||||||
@@ -15,5 +15,5 @@ inputs:
|
|||||||
$GITHUB_WORKSPACE as its working directory.
|
$GITHUB_WORKSPACE as its working directory.
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: '../lib/autobuild-action.js'
|
main: '../lib/autobuild-action.js'
|
||||||
|
|||||||
@@ -133,6 +133,6 @@ outputs:
|
|||||||
codeql-path:
|
codeql-path:
|
||||||
description: The path of the CodeQL binary used for analysis
|
description: The path of the CodeQL binary used for analysis
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node16
|
||||||
main: '../lib/init-action.js'
|
main: '../lib/init-action.js'
|
||||||
post: '../lib/init-action-post.js'
|
post: '../lib/init-action-post.js'
|
||||||
|
|||||||
2
lib/analyze.js
generated
2
lib/analyze.js
generated
@@ -174,7 +174,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
}
|
}
|
||||||
statusReport["event_reports"].push(perQueryAlertCountEventReport);
|
statusReport["event_reports"].push(perQueryAlertCountEventReport);
|
||||||
}
|
}
|
||||||
if (!(await util.codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_ANALYSIS_SUMMARY_V2))) {
|
if (!(await util.codeQlVersionAtLeast(codeql, codeql_1.CODEQL_VERSION_ANALYSIS_SUMMARY_V2))) {
|
||||||
await runPrintLinesOfCode(language);
|
await runPrintLinesOfCode(language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
lib/cli-errors.js
generated
6
lib/cli-errors.js
generated
@@ -116,6 +116,7 @@ function ensureEndsInPeriod(text) {
|
|||||||
/** Error messages from the CLI that we consider configuration errors and handle specially. */
|
/** Error messages from the CLI that we consider configuration errors and handle specially. */
|
||||||
var CliConfigErrorCategory;
|
var CliConfigErrorCategory;
|
||||||
(function (CliConfigErrorCategory) {
|
(function (CliConfigErrorCategory) {
|
||||||
|
CliConfigErrorCategory["ExternalRepositoryCloneFailed"] = "ExternalRepositoryCloneFailed";
|
||||||
CliConfigErrorCategory["GradleBuildFailed"] = "GradleBuildFailed";
|
CliConfigErrorCategory["GradleBuildFailed"] = "GradleBuildFailed";
|
||||||
CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion";
|
CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion";
|
||||||
CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice";
|
CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice";
|
||||||
@@ -134,6 +135,11 @@ var CliConfigErrorCategory;
|
|||||||
* would like to categorize an error as a configuration error or not.
|
* would like to categorize an error as a configuration error or not.
|
||||||
*/
|
*/
|
||||||
exports.cliErrorsConfig = {
|
exports.cliErrorsConfig = {
|
||||||
|
[CliConfigErrorCategory.ExternalRepositoryCloneFailed]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("Failed to clone external Git repository"),
|
||||||
|
],
|
||||||
|
},
|
||||||
[CliConfigErrorCategory.GradleBuildFailed]: {
|
[CliConfigErrorCategory.GradleBuildFailed]: {
|
||||||
cliErrorMessageCandidates: [
|
cliErrorMessageCandidates: [
|
||||||
new RegExp("[autobuild] FAILURE: Build failed with an exception."),
|
new RegExp("[autobuild] FAILURE: Build failed with an exception."),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
22
lib/codeql.js
generated
22
lib/codeql.js
generated
@@ -274,13 +274,13 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
if (qlconfigFile !== undefined) {
|
if (qlconfigFile !== undefined) {
|
||||||
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
||||||
}
|
}
|
||||||
if (await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG)) {
|
if (await util.codeQlVersionAtLeast(this, exports.CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG)) {
|
||||||
extraArgs.push("--calculate-language-specific-baseline");
|
extraArgs.push("--calculate-language-specific-baseline");
|
||||||
}
|
}
|
||||||
if (await isSublanguageFileCoverageEnabled(config, this)) {
|
if (await isSublanguageFileCoverageEnabled(config, this)) {
|
||||||
extraArgs.push("--sublanguage-file-coverage");
|
extraArgs.push("--sublanguage-file-coverage");
|
||||||
}
|
}
|
||||||
else if (await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
|
else if (await util.codeQlVersionAtLeast(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
|
||||||
extraArgs.push("--no-sublanguage-file-coverage");
|
extraArgs.push("--no-sublanguage-file-coverage");
|
||||||
}
|
}
|
||||||
await runTool(cmd, [
|
await runTool(cmd, [
|
||||||
@@ -469,7 +469,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
ignoringOptions: ["--expect-discarded-cache"],
|
ignoringOptions: ["--expect-discarded-cache"],
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
if (await util.codeQlVersionAbove(this, feature_flags_1.CODEQL_VERSION_FINE_GRAINED_PARALLELISM)) {
|
if (await util.codeQlVersionAtLeast(this, feature_flags_1.CODEQL_VERSION_FINE_GRAINED_PARALLELISM)) {
|
||||||
codeqlArgs.push("--intra-layer-parallelism");
|
codeqlArgs.push("--intra-layer-parallelism");
|
||||||
}
|
}
|
||||||
await runTool(cmd, codeqlArgs);
|
await runTool(cmd, codeqlArgs);
|
||||||
@@ -503,7 +503,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
if (await isSublanguageFileCoverageEnabled(config, this)) {
|
if (await isSublanguageFileCoverageEnabled(config, this)) {
|
||||||
codeqlArgs.push("--sublanguage-file-coverage");
|
codeqlArgs.push("--sublanguage-file-coverage");
|
||||||
}
|
}
|
||||||
else if (await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
|
else if (await util.codeQlVersionAtLeast(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
|
||||||
codeqlArgs.push("--no-sublanguage-file-coverage");
|
codeqlArgs.push("--no-sublanguage-file-coverage");
|
||||||
}
|
}
|
||||||
if (shouldExportDiagnostics) {
|
if (shouldExportDiagnostics) {
|
||||||
@@ -512,7 +512,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
else {
|
else {
|
||||||
codeqlArgs.push("--no-sarif-include-diagnostics");
|
codeqlArgs.push("--no-sarif-include-diagnostics");
|
||||||
}
|
}
|
||||||
if ((await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2)) &&
|
if ((await util.codeQlVersionAtLeast(this, exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2)) &&
|
||||||
!(0, tools_features_1.isSupportedToolsFeature)(await this.getVersion(), tools_features_1.ToolsFeature.AnalysisSummaryV2IsDefault)) {
|
!(0, tools_features_1.isSupportedToolsFeature)(await this.getVersion(), tools_features_1.ToolsFeature.AnalysisSummaryV2IsDefault)) {
|
||||||
codeqlArgs.push("--new-analysis-summary");
|
codeqlArgs.push("--new-analysis-summary");
|
||||||
}
|
}
|
||||||
@@ -693,12 +693,12 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
// would call getVersion(), so the CLI version would be cached as soon as the
|
// would call getVersion(), so the CLI version would be cached as soon as the
|
||||||
// CodeQL object is created.
|
// CodeQL object is created.
|
||||||
if (checkVersion &&
|
if (checkVersion &&
|
||||||
!(await util.codeQlVersionAbove(codeql, CODEQL_MINIMUM_VERSION))) {
|
!(await util.codeQlVersionAtLeast(codeql, CODEQL_MINIMUM_VERSION))) {
|
||||||
throw new util.ConfigurationError(`Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql.getVersion()).version}`);
|
throw new util.ConfigurationError(`Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql.getVersion()).version}`);
|
||||||
}
|
}
|
||||||
else if (checkVersion &&
|
else if (checkVersion &&
|
||||||
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
|
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
|
||||||
!(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION))) {
|
!(await util.codeQlVersionAtLeast(codeql, CODEQL_NEXT_MINIMUM_VERSION))) {
|
||||||
const result = await codeql.getVersion();
|
const result = await codeql.getVersion();
|
||||||
core.warning(`CodeQL CLI version ${result.version} was discontinued on ` +
|
core.warning(`CodeQL CLI version ${result.version} was discontinued on ` +
|
||||||
`${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ` +
|
`${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ` +
|
||||||
@@ -894,10 +894,10 @@ function getGeneratedCodeScanningConfigPath(config) {
|
|||||||
}
|
}
|
||||||
exports.getGeneratedCodeScanningConfigPath = getGeneratedCodeScanningConfigPath;
|
exports.getGeneratedCodeScanningConfigPath = getGeneratedCodeScanningConfigPath;
|
||||||
async function isDiagnosticsExportInvalidSarifFixed(codeql) {
|
async function isDiagnosticsExportInvalidSarifFixed(codeql) {
|
||||||
return await util.codeQlVersionAbove(codeql, exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED);
|
return await util.codeQlVersionAtLeast(codeql, exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED);
|
||||||
}
|
}
|
||||||
async function getLanguageAliasingArguments(codeql) {
|
async function getLanguageAliasingArguments(codeql) {
|
||||||
if (await util.codeQlVersionAbove(codeql, exports.CODEQL_VERSION_LANGUAGE_ALIASING)) {
|
if (await util.codeQlVersionAtLeast(codeql, exports.CODEQL_VERSION_LANGUAGE_ALIASING)) {
|
||||||
return ["--extractor-include-aliases"];
|
return ["--extractor-include-aliases"];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
@@ -907,10 +907,10 @@ async function isSublanguageFileCoverageEnabled(config, codeql) {
|
|||||||
// Sub-language file coverage is first supported in GHES 3.12.
|
// Sub-language file coverage is first supported in GHES 3.12.
|
||||||
(config.gitHubVersion.type !== util.GitHubVariant.GHES ||
|
(config.gitHubVersion.type !== util.GitHubVariant.GHES ||
|
||||||
semver.gte(config.gitHubVersion.version, "3.12.0")) &&
|
semver.gte(config.gitHubVersion.version, "3.12.0")) &&
|
||||||
(await util.codeQlVersionAbove(codeql, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)));
|
(await util.codeQlVersionAtLeast(codeql, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)));
|
||||||
}
|
}
|
||||||
async function getCodeScanningQueryHelpArguments(codeql) {
|
async function getCodeScanningQueryHelpArguments(codeql) {
|
||||||
if (await util.codeQlVersionAbove(codeql, CODEQL_VERSION_INCLUDE_QUERY_HELP)) {
|
if (await util.codeQlVersionAtLeast(codeql, CODEQL_VERSION_INCLUDE_QUERY_HELP)) {
|
||||||
return ["--sarif-include-query-help=always"];
|
return ["--sarif-include-query-help=always"];
|
||||||
}
|
}
|
||||||
return ["--sarif-add-query-help"];
|
return ["--sarif-add-query-help"];
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
lib/config-utils.js
generated
2
lib/config-utils.js
generated
@@ -176,7 +176,7 @@ exports.getLanguages = getLanguages;
|
|||||||
* version of the CLI.
|
* version of the CLI.
|
||||||
*/
|
*/
|
||||||
async function getLanguageAliases(codeql) {
|
async function getLanguageAliases(codeql) {
|
||||||
if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_LANGUAGE_ALIASING)) {
|
if (await (0, util_1.codeQlVersionAtLeast)(codeql, codeql_1.CODEQL_VERSION_LANGUAGE_ALIASING)) {
|
||||||
return (await codeql.betterResolveLanguages()).aliases;
|
return (await codeql.betterResolveLanguages()).aliases;
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bundleVersion": "codeql-bundle-v2.17.0",
|
"bundleVersion": "codeql-bundle-v2.17.1",
|
||||||
"cliVersion": "2.17.0",
|
"cliVersion": "2.17.1",
|
||||||
"priorBundleVersion": "codeql-bundle-v2.16.5",
|
"priorBundleVersion": "codeql-bundle-v2.17.0",
|
||||||
"priorCliVersion": "2.16.5"
|
"priorCliVersion": "2.17.0"
|
||||||
}
|
}
|
||||||
|
|||||||
2
lib/feature-flags.js
generated
2
lib/feature-flags.js
generated
@@ -144,7 +144,7 @@ class Features {
|
|||||||
// Never use this feature if the CLI version explicitly can't support it.
|
// Never use this feature if the CLI version explicitly can't support it.
|
||||||
const minimumVersion = exports.featureConfig[feature].minimumVersion;
|
const minimumVersion = exports.featureConfig[feature].minimumVersion;
|
||||||
if (codeql && minimumVersion) {
|
if (codeql && minimumVersion) {
|
||||||
if (!(await util.codeQlVersionAbove(codeql, minimumVersion))) {
|
if (!(await util.codeQlVersionAtLeast(codeql, minimumVersion))) {
|
||||||
this.logger.debug(`Feature ${feature} is disabled because the CodeQL CLI version is older than the minimum ` +
|
this.logger.debug(`Feature ${feature} is disabled because the CodeQL CLI version is older than the minimum ` +
|
||||||
`version ${minimumVersion}.`);
|
`version ${minimumVersion}.`);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
22
lib/init-action.js
generated
22
lib/init-action.js
generated
@@ -250,14 +250,14 @@ async function run() {
|
|||||||
core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
|
core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
|
||||||
}
|
}
|
||||||
const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
|
const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
|
||||||
if ((await (0, util_1.codeQlVersionAbove)(codeql, "2.13.4")) &&
|
if ((await (0, util_1.codeQlVersionAtLeast)(codeql, "2.13.4")) &&
|
||||||
!(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.4"))) {
|
!(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.14.4"))) {
|
||||||
core.exportVariable(kotlinLimitVar, "1.9.20");
|
core.exportVariable(kotlinLimitVar, "1.9.20");
|
||||||
}
|
}
|
||||||
if (config.languages.includes(languages_1.Language.java) &&
|
if (config.languages.includes(languages_1.Language.java) &&
|
||||||
// Java Lombok support is enabled by default for >= 2.14.4
|
// Java Lombok support is enabled by default for >= 2.14.4
|
||||||
(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.0")) &&
|
(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.14.0")) &&
|
||||||
!(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.4"))) {
|
!(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.14.4"))) {
|
||||||
const envVar = "CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS";
|
const envVar = "CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS";
|
||||||
if (process.env[envVar]) {
|
if (process.env[envVar]) {
|
||||||
logger.info(`Environment variable ${envVar} already set. Not en/disabling CodeQL Java Lombok support`);
|
logger.info(`Environment variable ${envVar} already set. Not en/disabling CodeQL Java Lombok support`);
|
||||||
@@ -282,17 +282,25 @@ async function run() {
|
|||||||
core.exportVariable(envVar, "false");
|
core.exportVariable(envVar, "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// For CLI versions <2.15.1, build tracing caused errors in MacOS ARM machines with
|
||||||
|
// System Integrity Protection (SIP) disabled.
|
||||||
|
if (!(await (0, util_1.codeQlVersionAtLeast)(codeql, "2.15.1")) &&
|
||||||
|
process.platform === "darwin" &&
|
||||||
|
(process.arch === "arm" || process.arch === "arm64") &&
|
||||||
|
!(await (0, init_1.isSipEnabled)(logger))) {
|
||||||
|
logger.warning("CodeQL versions 2.15.0 and lower are not supported on MacOS ARM machines with System Integrity Protection (SIP) disabled.");
|
||||||
|
}
|
||||||
// From 2.16.0 the default for the python extractor is to not perform any
|
// From 2.16.0 the default for the python extractor is to not perform any
|
||||||
// dependency extraction. For versions before that, you needed to set this flag to
|
// dependency extraction. For versions before that, you needed to set this flag to
|
||||||
// enable this behavior (supported since 2.13.1).
|
// enable this behavior (supported since 2.13.1).
|
||||||
if (await (0, util_1.codeQlVersionAbove)(codeql, "2.17.1")) {
|
if (await (0, util_1.codeQlVersionAtLeast)(codeql, "2.17.1")) {
|
||||||
// disabled by default, no warning
|
// disabled by default, no warning
|
||||||
}
|
}
|
||||||
else if (await (0, util_1.codeQlVersionAbove)(codeql, "2.16.0")) {
|
else if (await (0, util_1.codeQlVersionAtLeast)(codeql, "2.16.0")) {
|
||||||
// disabled by default, prints warning if environment variable is not set
|
// disabled by default, prints warning if environment variable is not set
|
||||||
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", "true");
|
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", "true");
|
||||||
}
|
}
|
||||||
else if (await (0, util_1.codeQlVersionAbove)(codeql, "2.13.1")) {
|
else if (await (0, util_1.codeQlVersionAtLeast)(codeql, "2.13.1")) {
|
||||||
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", "true");
|
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", "true");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/init.js
generated
24
lib/init.js
generated
@@ -23,9 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.checkInstallPython311 = exports.printPathFiltersWarning = exports.runInit = exports.initConfig = exports.initCodeQL = void 0;
|
exports.isSipEnabled = exports.checkInstallPython311 = exports.printPathFiltersWarning = exports.runInit = exports.initConfig = exports.initCodeQL = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
|
const exec = __importStar(require("@actions/exec/lib/exec"));
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
@@ -89,4 +90,25 @@ async function checkInstallPython311(languages, codeql) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.checkInstallPython311 = checkInstallPython311;
|
exports.checkInstallPython311 = checkInstallPython311;
|
||||||
|
// For MacOS runners: runs `csrutil status` to determine whether System
|
||||||
|
// Integrity Protection is enabled.
|
||||||
|
async function isSipEnabled(logger) {
|
||||||
|
try {
|
||||||
|
const sipStatusOutput = await exec.getExecOutput("csrutil status");
|
||||||
|
if (sipStatusOutput.exitCode === 0) {
|
||||||
|
if (sipStatusOutput.stdout.includes("System Integrity Protection status: enabled.")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (sipStatusOutput.stdout.includes("System Integrity Protection status: disabled.")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
logger.warning(`Failed to determine if System Integrity Protection was enabled: ${e}`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.isSipEnabled = isSipEnabled;
|
||||||
//# sourceMappingURL=init.js.map
|
//# sourceMappingURL=init.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,kEAAoD;AAGpD,qCAA+C;AAC/C,4DAA8C;AAE9C,2CAA0D;AAG1D,qDAAgD;AAChD,mDAAwE;AAGjE,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAOd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,GAClE,MAAM,IAAA,oBAAW,EACf,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,IAAI,CACL,CAAC;IACJ,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACxE,CAAC;AA3BD,gCA2BC;AAEM,KAAK,UAAU,UAAU,CAC9B,MAAoC,EACpC,MAAc;IAEd,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7B,MAAM,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACpD,IACE,CAAC,CAAC,MAAM,MAAM,CAAC,eAAe,CAC5B,6BAAY,CAAC,kCAAkC,CAChD,CAAC,EACF,CAAC;QACD,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AAhBD,gCAgBC;AAEM,KAAK,UAAU,OAAO,CAC3B,MAAc,EACd,MAA0B,EAC1B,UAAkB,EAClB,WAA+B,EAC/B,eAAmC,EACnC,UAAoC,EACpC,QAA2B,EAC3B,MAAc;IAEd,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAErD,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAC1C,MAAM,WAAW,CAAC,kBAAkB,CAClC,eAAe,EACf,MAAM,CAAC,OAAO,EACd,MAAM,CACP,CAAC;IACJ,MAAM,WAAW,CAAC,eAAe,CAC/B;QACE,YAAY,EAAE,UAAU,CAAC,IAAI;QAC7B,sBAAsB,EAAE,oBAAoB;KAC7C;IAED,0BAA0B;IAC1B,KAAK,IAAI,EAAE,CACT,MAAM,MAAM,CAAC,mBAAmB,CAC9B,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,MAAM,CACP,CACJ,CAAC;IACF,OAAO,MAAM,IAAA,uCAAuB,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC;AApCD,0BAoCC;AAED,SAAgB,uBAAuB,CACrC,MAA0B,EAC1B,MAAc;IAEd,qEAAqE;IACrE,sEAAsE;IACtE,IACE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM;QACrC,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QACnD,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,6BAAiB,CAAC,EAC1C,CAAC;QACD,MAAM,CAAC,OAAO,CACZ,mGAAmG,CACpG,CAAC;IACJ,CAAC;AACH,CAAC;AAfD,0DAeC;AAED;;;GAGG;AACI,KAAK,UAAU,qBAAqB,CACzC,SAAqB,EACrB,MAAc;IAEd,IACE,SAAS,CAAC,QAAQ,CAAC,oBAAQ,CAAC,MAAM,CAAC;QACnC,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,EAAE,iBAAiB,EACxD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CACzB,SAAS,EACT,iBAAiB,EACjB,oBAAoB,CACrB,CAAC;QACF,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE;YACvE,MAAM;SACP,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAlBD,sDAkBC"}
|
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,6DAA+C;AAC/C,yEAA2D;AAC3D,kEAAoD;AAGpD,qCAA+C;AAC/C,4DAA8C;AAE9C,2CAA0D;AAG1D,qDAAgD;AAChD,mDAAwE;AAGjE,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAOd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,GAClE,MAAM,IAAA,oBAAW,EACf,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,IAAI,CACL,CAAC;IACJ,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACxE,CAAC;AA3BD,gCA2BC;AAEM,KAAK,UAAU,UAAU,CAC9B,MAAoC,EACpC,MAAc;IAEd,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7B,MAAM,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACpD,IACE,CAAC,CAAC,MAAM,MAAM,CAAC,eAAe,CAC5B,6BAAY,CAAC,kCAAkC,CAChD,CAAC,EACF,CAAC;QACD,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AAhBD,gCAgBC;AAEM,KAAK,UAAU,OAAO,CAC3B,MAAc,EACd,MAA0B,EAC1B,UAAkB,EAClB,WAA+B,EAC/B,eAAmC,EACnC,UAAoC,EACpC,QAA2B,EAC3B,MAAc;IAEd,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAErD,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAC1C,MAAM,WAAW,CAAC,kBAAkB,CAClC,eAAe,EACf,MAAM,CAAC,OAAO,EACd,MAAM,CACP,CAAC;IACJ,MAAM,WAAW,CAAC,eAAe,CAC/B;QACE,YAAY,EAAE,UAAU,CAAC,IAAI;QAC7B,sBAAsB,EAAE,oBAAoB;KAC7C;IAED,0BAA0B;IAC1B,KAAK,IAAI,EAAE,CACT,MAAM,MAAM,CAAC,mBAAmB,CAC9B,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,MAAM,CACP,CACJ,CAAC;IACF,OAAO,MAAM,IAAA,uCAAuB,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC;AApCD,0BAoCC;AAED,SAAgB,uBAAuB,CACrC,MAA0B,EAC1B,MAAc;IAEd,qEAAqE;IACrE,sEAAsE;IACtE,IACE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM;QACrC,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QACnD,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,6BAAiB,CAAC,EAC1C,CAAC;QACD,MAAM,CAAC,OAAO,CACZ,mGAAmG,CACpG,CAAC;IACJ,CAAC;AACH,CAAC;AAfD,0DAeC;AAED;;;GAGG;AACI,KAAK,UAAU,qBAAqB,CACzC,SAAqB,EACrB,MAAc;IAEd,IACE,SAAS,CAAC,QAAQ,CAAC,oBAAQ,CAAC,MAAM,CAAC;QACnC,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,EAAE,iBAAiB,EACxD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CACzB,SAAS,EACT,iBAAiB,EACjB,oBAAoB,CACrB,CAAC;QACF,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE;YACvE,MAAM;SACP,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAlBD,sDAkBC;AAED,uEAAuE;AACvE,mCAAmC;AAC5B,KAAK,UAAU,YAAY,CAAC,MAAM;IACvC,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACnE,IAAI,eAAe,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnC,IACE,eAAe,CAAC,MAAM,CAAC,QAAQ,CAC7B,8CAA8C,CAC/C,EACD,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IACE,eAAe,CAAC,MAAM,CAAC,QAAQ,CAC7B,+CAA+C,CAChD,EACD,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,OAAO,CACZ,mEAAmE,CAAC,EAAE,CACvE,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AA1BD,oCA0BC"}
|
||||||
4
lib/resolve-environment.js
generated
4
lib/resolve-environment.js
generated
@@ -33,7 +33,7 @@ async function runResolveBuildEnvironment(cmd, logger, workingDir, languageInput
|
|||||||
let language = languageInput;
|
let language = languageInput;
|
||||||
// If the CodeQL CLI version in use supports language aliasing, give the CLI the raw language
|
// If the CodeQL CLI version in use supports language aliasing, give the CLI the raw language
|
||||||
// input. Otherwise, parse the language input and give the CLI the parsed language.
|
// input. Otherwise, parse the language input and give the CLI the parsed language.
|
||||||
if (!(await util.codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_LANGUAGE_ALIASING))) {
|
if (!(await util.codeQlVersionAtLeast(codeql, codeql_1.CODEQL_VERSION_LANGUAGE_ALIASING))) {
|
||||||
const parsedLanguage = (0, languages_1.parseLanguage)(languageInput)?.toString();
|
const parsedLanguage = (0, languages_1.parseLanguage)(languageInput)?.toString();
|
||||||
if (parsedLanguage === undefined) {
|
if (parsedLanguage === undefined) {
|
||||||
throw new util.ConfigurationError(`Did not recognize the language '${languageInput}'.`);
|
throw new util.ConfigurationError(`Did not recognize the language '${languageInput}'.`);
|
||||||
@@ -43,7 +43,7 @@ async function runResolveBuildEnvironment(cmd, logger, workingDir, languageInput
|
|||||||
let result = {};
|
let result = {};
|
||||||
// If the CodeQL version in use does not support the `resolve build-environment`
|
// If the CodeQL version in use does not support the `resolve build-environment`
|
||||||
// command, just return an empty configuration. Otherwise invoke the CLI.
|
// command, just return an empty configuration. Otherwise invoke the CLI.
|
||||||
if (!(await util.codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_RESOLVE_ENVIRONMENT))) {
|
if (!(await util.codeQlVersionAtLeast(codeql, codeql_1.CODEQL_VERSION_RESOLVE_ENVIRONMENT))) {
|
||||||
logger.warning("Unsupported CodeQL CLI version for `resolve build-environment` command, " +
|
logger.warning("Unsupported CodeQL CLI version for `resolve build-environment` command, " +
|
||||||
"returning an empty configuration.");
|
"returning an empty configuration.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"resolve-environment.js","sourceRoot":"","sources":["../src/resolve-environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAIkB;AAClB,2CAA4C;AAE5C,6CAA+B;AAExB,KAAK,UAAU,0BAA0B,CAC9C,GAAW,EACX,MAAc,EACd,UAA8B,EAC9B,aAAqB;IAErB,MAAM,CAAC,UAAU,CACf,+CAA+C,aAAa,EAAE,CAC/D,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC;IAEpC,IAAI,QAAQ,GAAG,aAAa,CAAC;IAC7B,6FAA6F;IAC7F,mFAAmF;IACnF,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,yCAAgC,CAAC,CAAC,EAC1E,CAAC;QACD,MAAM,cAAc,GAAG,IAAA,yBAAa,EAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC;QAChE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,IAAI,CAAC,kBAAkB,CAC/B,mCAAmC,aAAa,IAAI,CACrD,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,cAAc,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,gFAAgF;IAChF,yEAAyE;IACzE,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,2CAAkC,CAAC,CAAC,EAC5E,CAAC;QACD,MAAM,CAAC,OAAO,CACZ,0EAA0E;YACxE,mCAAmC,CACtC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,SAAS,UAAU,4BAA4B,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AAhDD,gEAgDC"}
|
{"version":3,"file":"resolve-environment.js","sourceRoot":"","sources":["../src/resolve-environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAIkB;AAClB,2CAA4C;AAE5C,6CAA+B;AAExB,KAAK,UAAU,0BAA0B,CAC9C,GAAW,EACX,MAAc,EACd,UAA8B,EAC9B,aAAqB;IAErB,MAAM,CAAC,UAAU,CACf,+CAA+C,aAAa,EAAE,CAC/D,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC;IAEpC,IAAI,QAAQ,GAAG,aAAa,CAAC;IAC7B,6FAA6F;IAC7F,mFAAmF;IACnF,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,yCAAgC,CAAC,CAAC,EAC5E,CAAC;QACD,MAAM,cAAc,GAAG,IAAA,yBAAa,EAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC;QAChE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,IAAI,CAAC,kBAAkB,CAC/B,mCAAmC,aAAa,IAAI,CACrD,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,cAAc,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,gFAAgF;IAChF,yEAAyE;IACzE,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAC/B,MAAM,EACN,2CAAkC,CACnC,CAAC,EACF,CAAC;QACD,MAAM,CAAC,OAAO,CACZ,0EAA0E;YACxE,mCAAmC,CACtC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,SAAS,UAAU,4BAA4B,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AAnDD,gEAmDC"}
|
||||||
5
lib/upload-lib.js
generated
5
lib/upload-lib.js
generated
@@ -293,8 +293,7 @@ function validateSarifFileSchema(sarifFilePath, logger) {
|
|||||||
exports.validateSarifFileSchema = validateSarifFileSchema;
|
exports.validateSarifFileSchema = validateSarifFileSchema;
|
||||||
// buildPayload constructs a map ready to be uploaded to the API from the given
|
// buildPayload constructs a map ready to be uploaded to the API from the given
|
||||||
// parameters, respecting the current mode and target GitHub instance version.
|
// parameters, respecting the current mode and target GitHub instance version.
|
||||||
function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, mergeBaseCommitOid, logger) {
|
function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, mergeBaseCommitOid) {
|
||||||
logger.info(`Combining SARIF files using CLI`);
|
|
||||||
const payloadObj = {
|
const payloadObj = {
|
||||||
commit_oid: commitOid,
|
commit_oid: commitOid,
|
||||||
ref,
|
ref,
|
||||||
@@ -355,7 +354,7 @@ async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKe
|
|||||||
logger.debug(`Compressing serialized SARIF`);
|
logger.debug(`Compressing serialized SARIF`);
|
||||||
const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64");
|
const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64");
|
||||||
const checkoutURI = (0, file_url_1.default)(sourceRoot);
|
const checkoutURI = (0, file_url_1.default)(sourceRoot);
|
||||||
const payload = buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, await actionsUtil.determineMergeBaseCommitOid(), logger);
|
const payload = buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, await actionsUtil.determineMergeBaseCommitOid());
|
||||||
// Log some useful debug info about the info
|
// Log some useful debug info about the info
|
||||||
const rawUploadSizeBytes = sarifPayload.length;
|
const rawUploadSizeBytes = sarifPayload.length;
|
||||||
logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`);
|
logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
lib/upload-lib.test.js
generated
6
lib/upload-lib.test.js
generated
@@ -47,7 +47,7 @@ ava_1.default.beforeEach(() => {
|
|||||||
});
|
});
|
||||||
(0, ava_1.default)("validate correct payload used for push, PR merge commit, and PR head", async (t) => {
|
(0, ava_1.default)("validate correct payload used for push, PR merge commit, and PR head", async (t) => {
|
||||||
process.env["GITHUB_EVENT_NAME"] = "push";
|
process.env["GITHUB_EVENT_NAME"] = "push";
|
||||||
const pushPayload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit", (0, logging_1.getRunnerLogger)(true));
|
const pushPayload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit");
|
||||||
// Not triggered by a pull request
|
// Not triggered by a pull request
|
||||||
t.falsy(pushPayload.base_ref);
|
t.falsy(pushPayload.base_ref);
|
||||||
t.falsy(pushPayload.base_sha);
|
t.falsy(pushPayload.base_sha);
|
||||||
@@ -55,11 +55,11 @@ ava_1.default.beforeEach(() => {
|
|||||||
process.env["GITHUB_SHA"] = "commit";
|
process.env["GITHUB_SHA"] = "commit";
|
||||||
process.env["GITHUB_BASE_REF"] = "master";
|
process.env["GITHUB_BASE_REF"] = "master";
|
||||||
process.env["GITHUB_EVENT_PATH"] = `${__dirname}/../src/testdata/pull_request.json`;
|
process.env["GITHUB_EVENT_PATH"] = `${__dirname}/../src/testdata/pull_request.json`;
|
||||||
const prMergePayload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit", (0, logging_1.getRunnerLogger)(true));
|
const prMergePayload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit");
|
||||||
// Uploads for a merge commit use the merge base
|
// Uploads for a merge commit use the merge base
|
||||||
t.deepEqual(prMergePayload.base_ref, "refs/heads/master");
|
t.deepEqual(prMergePayload.base_ref, "refs/heads/master");
|
||||||
t.deepEqual(prMergePayload.base_sha, "mergeBaseCommit");
|
t.deepEqual(prMergePayload.base_sha, "mergeBaseCommit");
|
||||||
const prHeadPayload = uploadLib.buildPayload("headCommit", "refs/pull/123/head", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit", (0, logging_1.getRunnerLogger)(true));
|
const prHeadPayload = uploadLib.buildPayload("headCommit", "refs/pull/123/head", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit");
|
||||||
// Uploads for the head use the PR base
|
// Uploads for the head use the PR base
|
||||||
t.deepEqual(prHeadPayload.base_ref, "refs/heads/master");
|
t.deepEqual(prHeadPayload.base_ref, "refs/heads/master");
|
||||||
t.deepEqual(prHeadPayload.base_sha, "f95f852bd8fca8fcc58a9a2d6c842781e32a215e");
|
t.deepEqual(prHeadPayload.base_sha, "f95f852bd8fca8fcc58a9a2d6c842781e32a215e");
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
lib/util.js
generated
6
lib/util.js
generated
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.BuildMode = exports.checkActionVersion = exports.checkDiskUsage = exports.prettyPrintPack = exports.getErrorMessage = exports.wrapError = exports.fixInvalidNotificationsInFile = exports.fixInvalidNotifications = exports.parseMatrixInput = exports.isHostedRunner = exports.checkForTimeout = exports.withTimeout = exports.tryGetFolderBytes = exports.listFolder = exports.doesDirectoryExist = exports.isInTestMode = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.getCachedCodeQlVersion = exports.cacheCodeQlVersion = exports.isHTTPError = exports.ConfigurationError = exports.HTTPError = exports.getRequiredEnvParam = exports.initializeEnvironment = exports.assertNever = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getCgroupCpuCountFromCpus = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.getMemoryFlagValueForPlatform = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0;
|
exports.BuildMode = exports.checkActionVersion = exports.checkDiskUsage = exports.prettyPrintPack = exports.getErrorMessage = exports.wrapError = exports.fixInvalidNotificationsInFile = exports.fixInvalidNotifications = exports.parseMatrixInput = exports.isHostedRunner = exports.checkForTimeout = exports.withTimeout = exports.tryGetFolderBytes = exports.listFolder = exports.doesDirectoryExist = exports.isInTestMode = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAtLeast = exports.getCachedCodeQlVersion = exports.cacheCodeQlVersion = exports.isHTTPError = exports.ConfigurationError = exports.HTTPError = exports.getRequiredEnvParam = exports.initializeEnvironment = exports.assertNever = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getCgroupCpuCountFromCpus = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.getMemoryFlagValueForPlatform = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const os = __importStar(require("os"));
|
const os = __importStar(require("os"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
@@ -504,10 +504,10 @@ function getCachedCodeQlVersion() {
|
|||||||
return cachedCodeQlVersion;
|
return cachedCodeQlVersion;
|
||||||
}
|
}
|
||||||
exports.getCachedCodeQlVersion = getCachedCodeQlVersion;
|
exports.getCachedCodeQlVersion = getCachedCodeQlVersion;
|
||||||
async function codeQlVersionAbove(codeql, requiredVersion) {
|
async function codeQlVersionAtLeast(codeql, requiredVersion) {
|
||||||
return semver.gte((await codeql.getVersion()).version, requiredVersion);
|
return semver.gte((await codeql.getVersion()).version, requiredVersion);
|
||||||
}
|
}
|
||||||
exports.codeQlVersionAbove = codeQlVersionAbove;
|
exports.codeQlVersionAtLeast = codeQlVersionAtLeast;
|
||||||
// Create a bundle for the given DB, if it doesn't already exist
|
// Create a bundle for the given DB, if it doesn't already exist
|
||||||
async function bundleDb(config, language, codeql, dbName) {
|
async function bundleDb(config, language, codeql, dbName) {
|
||||||
const databasePath = getCodeQLDatabasePath(config, language);
|
const databasePath = getCodeQLDatabasePath(config, language);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
114
node_modules/.package-lock.json
generated
vendored
114
node_modules/.package-lock.json
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codeql",
|
"name": "codeql",
|
||||||
"version": "3.25.1",
|
"version": "2.25.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
@@ -762,17 +762,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@octokit/types": {
|
"node_modules/@octokit/types": {
|
||||||
"version": "13.4.0",
|
"version": "13.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz",
|
||||||
"integrity": "sha512-WlMegy3lPXYWASe3k9Jslc5a0anrYAYMWtsFrxBTdQjS70hvLH6C+PGvHbOsgy3RA3LouGJoU/vAt4KarecQLQ==",
|
"integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@octokit/openapi-types": "^22.0.1"
|
"@octokit/openapi-types": "^22.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@octokit/types/node_modules/@octokit/openapi-types": {
|
"node_modules/@octokit/types/node_modules/@octokit/openapi-types": {
|
||||||
"version": "22.0.1",
|
"version": "22.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz",
|
||||||
"integrity": "sha512-1yN5m1IMNXthoBDUXFF97N1gHop04B3H8ws7wtOr8GgRyDO1gKALjwMHARNBoMBiB/2vEe/vxstrApcJZzQbnQ=="
|
"integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q=="
|
||||||
},
|
},
|
||||||
"node_modules/@opentelemetry/api": {
|
"node_modules/@opentelemetry/api": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
@@ -896,12 +896,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.9.0",
|
"version": "16.11.22",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.22.tgz",
|
||||||
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==",
|
"integrity": "sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA=="
|
||||||
"dependencies": {
|
|
||||||
"undici-types": "~5.26.4"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/@types/node-fetch": {
|
"node_modules/@types/node-fetch": {
|
||||||
"version": "2.6.4",
|
"version": "2.6.4",
|
||||||
@@ -960,16 +957,16 @@
|
|||||||
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz",
|
||||||
"integrity": "sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ==",
|
"integrity": "sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.10.0",
|
"@eslint-community/regexpp": "^4.10.0",
|
||||||
"@typescript-eslint/scope-manager": "7.7.0",
|
"@typescript-eslint/scope-manager": "7.7.1",
|
||||||
"@typescript-eslint/type-utils": "7.7.0",
|
"@typescript-eslint/type-utils": "7.7.1",
|
||||||
"@typescript-eslint/utils": "7.7.0",
|
"@typescript-eslint/utils": "7.7.1",
|
||||||
"@typescript-eslint/visitor-keys": "7.7.0",
|
"@typescript-eslint/visitor-keys": "7.7.1",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"graphemer": "^1.4.0",
|
"graphemer": "^1.4.0",
|
||||||
"ignore": "^5.3.1",
|
"ignore": "^5.3.1",
|
||||||
@@ -995,15 +992,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.1.tgz",
|
||||||
"integrity": "sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==",
|
"integrity": "sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "7.7.0",
|
"@typescript-eslint/scope-manager": "7.7.1",
|
||||||
"@typescript-eslint/types": "7.7.0",
|
"@typescript-eslint/types": "7.7.1",
|
||||||
"@typescript-eslint/typescript-estree": "7.7.0",
|
"@typescript-eslint/typescript-estree": "7.7.1",
|
||||||
"@typescript-eslint/visitor-keys": "7.7.0",
|
"@typescript-eslint/visitor-keys": "7.7.1",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1023,13 +1020,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.1.tgz",
|
||||||
"integrity": "sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==",
|
"integrity": "sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "7.7.0",
|
"@typescript-eslint/types": "7.7.1",
|
||||||
"@typescript-eslint/visitor-keys": "7.7.0"
|
"@typescript-eslint/visitor-keys": "7.7.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || >=20.0.0"
|
"node": "^18.18.0 || >=20.0.0"
|
||||||
@@ -1040,13 +1037,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.1.tgz",
|
||||||
"integrity": "sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg==",
|
"integrity": "sha512-ZksJLW3WF7o75zaBPScdW1Gbkwhd/lyeXGf1kQCxJaOeITscoSl0MjynVvCzuV5boUz/3fOI06Lz8La55mu29Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/typescript-estree": "7.7.0",
|
"@typescript-eslint/typescript-estree": "7.7.1",
|
||||||
"@typescript-eslint/utils": "7.7.0",
|
"@typescript-eslint/utils": "7.7.1",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"ts-api-utils": "^1.3.0"
|
"ts-api-utils": "^1.3.0"
|
||||||
},
|
},
|
||||||
@@ -1067,9 +1064,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.1.tgz",
|
||||||
"integrity": "sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==",
|
"integrity": "sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || >=20.0.0"
|
"node": "^18.18.0 || >=20.0.0"
|
||||||
@@ -1080,13 +1077,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.1.tgz",
|
||||||
"integrity": "sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==",
|
"integrity": "sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "7.7.0",
|
"@typescript-eslint/types": "7.7.1",
|
||||||
"@typescript-eslint/visitor-keys": "7.7.0",
|
"@typescript-eslint/visitor-keys": "7.7.1",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"globby": "^11.1.0",
|
"globby": "^11.1.0",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
@@ -1132,17 +1129,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.1.tgz",
|
||||||
"integrity": "sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig==",
|
"integrity": "sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.4.0",
|
"@eslint-community/eslint-utils": "^4.4.0",
|
||||||
"@types/json-schema": "^7.0.15",
|
"@types/json-schema": "^7.0.15",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@typescript-eslint/scope-manager": "7.7.0",
|
"@typescript-eslint/scope-manager": "7.7.1",
|
||||||
"@typescript-eslint/types": "7.7.0",
|
"@typescript-eslint/types": "7.7.1",
|
||||||
"@typescript-eslint/typescript-estree": "7.7.0",
|
"@typescript-eslint/typescript-estree": "7.7.1",
|
||||||
"semver": "^7.6.0"
|
"semver": "^7.6.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1157,12 +1154,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "7.7.0",
|
"version": "7.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.1.tgz",
|
||||||
"integrity": "sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==",
|
"integrity": "sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "7.7.0",
|
"@typescript-eslint/types": "7.7.1",
|
||||||
"eslint-visitor-keys": "^3.4.3"
|
"eslint-visitor-keys": "^3.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -6089,11 +6086,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
|
||||||
"version": "5.26.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
|
||||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
|
||||||
},
|
|
||||||
"node_modules/universal-user-agent": {
|
"node_modules/universal-user-agent": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||||
|
|||||||
2
node_modules/@octokit/types/dist-types/VERSION.d.ts
generated
vendored
2
node_modules/@octokit/types/dist-types/VERSION.d.ts
generated
vendored
@@ -1 +1 @@
|
|||||||
export declare const VERSION = "13.4.0";
|
export declare const VERSION = "13.4.1";
|
||||||
|
|||||||
4
node_modules/@octokit/types/node_modules/@octokit/openapi-types/package.json
generated
vendored
4
node_modules/@octokit/types/node_modules/@octokit/openapi-types/package.json
generated
vendored
@@ -10,12 +10,12 @@
|
|||||||
"access": "public",
|
"access": "public",
|
||||||
"provenance": true
|
"provenance": true
|
||||||
},
|
},
|
||||||
"version": "22.0.1",
|
"version": "22.1.0",
|
||||||
"main": "",
|
"main": "",
|
||||||
"types": "types.d.ts",
|
"types": "types.d.ts",
|
||||||
"author": "Gregor Martynus (https://twitter.com/gr2m)",
|
"author": "Gregor Martynus (https://twitter.com/gr2m)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"octokit": {
|
"octokit": {
|
||||||
"openapi-version": "16.1.0"
|
"openapi-version": "16.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1962
node_modules/@octokit/types/node_modules/@octokit/openapi-types/types.d.ts
generated
vendored
1962
node_modules/@octokit/types/node_modules/@octokit/openapi-types/types.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
6
node_modules/@octokit/types/package.json
generated
vendored
6
node_modules/@octokit/types/package.json
generated
vendored
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@octokit/types",
|
"name": "@octokit/types",
|
||||||
"version": "13.4.0",
|
"version": "13.4.1",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"provenance": true
|
"provenance": true
|
||||||
},
|
},
|
||||||
"description": "Shared TypeScript definitions for Octokit projects",
|
"description": "Shared TypeScript definitions for Octokit projects",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@octokit/openapi-types": "^22.0.1"
|
"@octokit/openapi-types": "^22.1.0"
|
||||||
},
|
},
|
||||||
"repository": "github:octokit/types.ts",
|
"repository": "github:octokit/types.ts",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
"typescript": "^5.0.0"
|
"typescript": "^5.0.0"
|
||||||
},
|
},
|
||||||
"octokit": {
|
"octokit": {
|
||||||
"openapi-version": "16.1.0"
|
"openapi-version": "16.2.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist-types/**"
|
"dist-types/**"
|
||||||
|
|||||||
0
node_modules/@types/node/LICENSE
generated
vendored
Normal file → Executable file
0
node_modules/@types/node/LICENSE
generated
vendored
Normal file → Executable file
11
node_modules/@types/node/README.md
generated
vendored
Normal file → Executable file
11
node_modules/@types/node/README.md
generated
vendored
Normal file → Executable file
@@ -2,14 +2,15 @@
|
|||||||
> `npm install --save @types/node`
|
> `npm install --save @types/node`
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
This package contains type definitions for node (https://nodejs.org/).
|
This package contains type definitions for Node.js (https://nodejs.org/).
|
||||||
|
|
||||||
# Details
|
# Details
|
||||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
|
||||||
|
|
||||||
### Additional Details
|
### Additional Details
|
||||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
* Last updated: Tue, 01 Feb 2022 08:31:30 GMT
|
||||||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
* Dependencies: none
|
||||||
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
|
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Seth Westphal](https://github.com/westy92), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
|
||||||
|
|||||||
282
node_modules/@types/node/assert.d.ts
generated
vendored
Normal file → Executable file
282
node_modules/@types/node/assert.d.ts
generated
vendored
Normal file → Executable file
@@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:assert` module provides a set of assertion functions for verifying
|
* The `assert` module provides a set of assertion functions for verifying
|
||||||
* invariants.
|
* invariants.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
|
||||||
*/
|
*/
|
||||||
declare module "assert" {
|
declare module 'assert' {
|
||||||
/**
|
/**
|
||||||
* An alias of {@link ok}.
|
* An alias of {@link ok}.
|
||||||
* @since v0.5.9
|
* @since v0.5.9
|
||||||
@@ -12,29 +12,15 @@ declare module "assert" {
|
|||||||
function assert(value: unknown, message?: string | Error): asserts value;
|
function assert(value: unknown, message?: string | Error): asserts value;
|
||||||
namespace assert {
|
namespace assert {
|
||||||
/**
|
/**
|
||||||
* Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class.
|
* Indicates the failure of an assertion. All errors thrown by the `assert` module
|
||||||
|
* will be instances of the `AssertionError` class.
|
||||||
*/
|
*/
|
||||||
class AssertionError extends Error {
|
class AssertionError extends Error {
|
||||||
/**
|
|
||||||
* Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
|
|
||||||
*/
|
|
||||||
actual: unknown;
|
actual: unknown;
|
||||||
/**
|
|
||||||
* Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
|
|
||||||
*/
|
|
||||||
expected: unknown;
|
expected: unknown;
|
||||||
/**
|
|
||||||
* Set to the passed in operator value.
|
|
||||||
*/
|
|
||||||
operator: string;
|
operator: string;
|
||||||
/**
|
|
||||||
* Indicates if the message was auto-generated (`true`) or not.
|
|
||||||
*/
|
|
||||||
generatedMessage: boolean;
|
generatedMessage: boolean;
|
||||||
/**
|
code: 'ERR_ASSERTION';
|
||||||
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
|
|
||||||
*/
|
|
||||||
code: "ERR_ASSERTION";
|
|
||||||
constructor(options?: {
|
constructor(options?: {
|
||||||
/** If provided, the error message is set to this value. */
|
/** If provided, the error message is set to this value. */
|
||||||
message?: string | undefined;
|
message?: string | undefined;
|
||||||
@@ -50,10 +36,9 @@ declare module "assert" {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This feature is deprecated and will be removed in a future version.
|
* This feature is currently experimental and behavior might still change.
|
||||||
* Please consider using alternatives such as the `mock` helper function.
|
|
||||||
* @since v14.2.0, v12.19.0
|
* @since v14.2.0, v12.19.0
|
||||||
* @deprecated Deprecated
|
* @experimental
|
||||||
*/
|
*/
|
||||||
class CallTracker {
|
class CallTracker {
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +47,7 @@ declare module "assert" {
|
|||||||
* error.
|
* error.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* // Creates call tracker.
|
* // Creates call tracker.
|
||||||
* const tracker = new assert.CallTracker();
|
* const tracker = new assert.CallTracker();
|
||||||
@@ -80,44 +65,26 @@ declare module "assert" {
|
|||||||
*/
|
*/
|
||||||
calls(exact?: number): () => void;
|
calls(exact?: number): () => void;
|
||||||
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
||||||
/**
|
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import assert from 'node:assert';
|
|
||||||
*
|
|
||||||
* const tracker = new assert.CallTracker();
|
|
||||||
*
|
|
||||||
* function func() {}
|
|
||||||
* const callsfunc = tracker.calls(func);
|
|
||||||
* callsfunc(1, 2, 3);
|
|
||||||
*
|
|
||||||
* assert.deepStrictEqual(tracker.getCalls(callsfunc),
|
|
||||||
* [{ thisArg: undefined, arguments: [1, 2, 3] }]);
|
|
||||||
* ```
|
|
||||||
* @since v18.8.0, v16.18.0
|
|
||||||
* @param fn
|
|
||||||
* @return An Array with all the calls to a tracked function.
|
|
||||||
*/
|
|
||||||
getCalls(fn: Function): CallTrackerCall[];
|
|
||||||
/**
|
/**
|
||||||
* The arrays contains information about the expected and actual number of calls of
|
* The arrays contains information about the expected and actual number of calls of
|
||||||
* the functions that have not been called the expected number of times.
|
* the functions that have not been called the expected number of times.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* // Creates call tracker.
|
* // Creates call tracker.
|
||||||
* const tracker = new assert.CallTracker();
|
* const tracker = new assert.CallTracker();
|
||||||
*
|
*
|
||||||
* function func() {}
|
* function func() {}
|
||||||
*
|
*
|
||||||
|
* function foo() {}
|
||||||
|
*
|
||||||
* // Returns a function that wraps func() that must be called exact times
|
* // Returns a function that wraps func() that must be called exact times
|
||||||
* // before tracker.verify().
|
* // before tracker.verify().
|
||||||
* const callsfunc = tracker.calls(func, 2);
|
* const callsfunc = tracker.calls(func, 2);
|
||||||
*
|
*
|
||||||
* // Returns an array containing information on callsfunc()
|
* // Returns an array containing information on callsfunc()
|
||||||
* console.log(tracker.report());
|
* tracker.report();
|
||||||
* // [
|
* // [
|
||||||
* // {
|
* // {
|
||||||
* // message: 'Expected the func function to be executed 2 time(s) but was
|
* // message: 'Expected the func function to be executed 2 time(s) but was
|
||||||
@@ -130,39 +97,15 @@ declare module "assert" {
|
|||||||
* // ]
|
* // ]
|
||||||
* ```
|
* ```
|
||||||
* @since v14.2.0, v12.19.0
|
* @since v14.2.0, v12.19.0
|
||||||
* @return An Array of objects containing information about the wrapper functions returned by `calls`.
|
* @return of objects containing information about the wrapper functions returned by `calls`.
|
||||||
*/
|
*/
|
||||||
report(): CallTrackerReportInformation[];
|
report(): CallTrackerReportInformation[];
|
||||||
/**
|
|
||||||
* Reset calls of the call tracker.
|
|
||||||
* If a tracked function is passed as an argument, the calls will be reset for it.
|
|
||||||
* If no arguments are passed, all tracked functions will be reset.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import assert from 'node:assert';
|
|
||||||
*
|
|
||||||
* const tracker = new assert.CallTracker();
|
|
||||||
*
|
|
||||||
* function func() {}
|
|
||||||
* const callsfunc = tracker.calls(func);
|
|
||||||
*
|
|
||||||
* callsfunc();
|
|
||||||
* // Tracker was called once
|
|
||||||
* assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
|
|
||||||
*
|
|
||||||
* tracker.reset(callsfunc);
|
|
||||||
* assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
|
|
||||||
* ```
|
|
||||||
* @since v18.8.0, v16.18.0
|
|
||||||
* @param fn a tracked function to reset.
|
|
||||||
*/
|
|
||||||
reset(fn?: Function): void;
|
|
||||||
/**
|
/**
|
||||||
* Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that
|
* Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that
|
||||||
* have not been called the expected number of times.
|
* have not been called the expected number of times.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* // Creates call tracker.
|
* // Creates call tracker.
|
||||||
* const tracker = new assert.CallTracker();
|
* const tracker = new assert.CallTracker();
|
||||||
@@ -182,10 +125,6 @@ declare module "assert" {
|
|||||||
*/
|
*/
|
||||||
verify(): void;
|
verify(): void;
|
||||||
}
|
}
|
||||||
interface CallTrackerCall {
|
|
||||||
thisArg: object;
|
|
||||||
arguments: unknown[];
|
|
||||||
}
|
|
||||||
interface CallTrackerReportInformation {
|
interface CallTrackerReportInformation {
|
||||||
message: string;
|
message: string;
|
||||||
/** The actual number of times the function was called. */
|
/** The actual number of times the function was called. */
|
||||||
@@ -197,14 +136,14 @@ declare module "assert" {
|
|||||||
/** A stack trace of the function. */
|
/** A stack trace of the function. */
|
||||||
stack: object;
|
stack: object;
|
||||||
}
|
}
|
||||||
type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
|
type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
|
||||||
/**
|
/**
|
||||||
* Throws an `AssertionError` with the provided error message or a default
|
* Throws an `AssertionError` with the provided error message or a default
|
||||||
* error message. If the `message` parameter is an instance of an `Error` then
|
* error message. If the `message` parameter is an instance of an `Error` then
|
||||||
* it will be thrown instead of the `AssertionError`.
|
* it will be thrown instead of the `AssertionError`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.fail();
|
* assert.fail();
|
||||||
* // AssertionError [ERR_ASSERTION]: Failed
|
* // AssertionError [ERR_ASSERTION]: Failed
|
||||||
@@ -229,7 +168,7 @@ declare module "assert" {
|
|||||||
message?: string | Error,
|
message?: string | Error,
|
||||||
operator?: string,
|
operator?: string,
|
||||||
// tslint:disable-next-line:ban-types
|
// tslint:disable-next-line:ban-types
|
||||||
stackStartFn?: Function,
|
stackStartFn?: Function
|
||||||
): never;
|
): never;
|
||||||
/**
|
/**
|
||||||
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
|
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
|
||||||
@@ -242,7 +181,7 @@ declare module "assert" {
|
|||||||
* thrown in a file! See below for further details.
|
* thrown in a file! See below for further details.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.ok(true);
|
* assert.ok(true);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -277,7 +216,7 @@ declare module "assert" {
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* // Using `assert()` works the same:
|
* // Using `assert()` works the same:
|
||||||
* assert(0);
|
* assert(0);
|
||||||
@@ -298,11 +237,11 @@ declare module "assert" {
|
|||||||
* > Stability: 3 - Legacy: Use {@link strictEqual} instead.
|
* > Stability: 3 - Legacy: Use {@link strictEqual} instead.
|
||||||
*
|
*
|
||||||
* Tests shallow, coercive equality between the `actual` and `expected` parameters
|
* Tests shallow, coercive equality between the `actual` and `expected` parameters
|
||||||
* using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled
|
* using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled
|
||||||
* and treated as being identical if both sides are `NaN`.
|
* and treated as being identical in case both sides are `NaN`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* assert.equal(1, 1);
|
* assert.equal(1, 1);
|
||||||
* // OK, 1 == 1
|
* // OK, 1 == 1
|
||||||
@@ -331,11 +270,12 @@ declare module "assert" {
|
|||||||
*
|
*
|
||||||
* > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
|
* > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
|
||||||
*
|
*
|
||||||
* Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is
|
* Tests shallow, coercive inequality with the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison)(`!=` ). `NaN` is special handled and treated as
|
||||||
* specially handled and treated as being identical if both sides are `NaN`.
|
* being identical in case both
|
||||||
|
* sides are `NaN`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* assert.notEqual(1, 2);
|
* assert.notEqual(1, 2);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -382,24 +322,24 @@ declare module "assert" {
|
|||||||
* Tests for any deep inequality. Opposite of {@link deepEqual}.
|
* Tests for any deep inequality. Opposite of {@link deepEqual}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert';
|
* import assert from 'assert';
|
||||||
*
|
*
|
||||||
* const obj1 = {
|
* const obj1 = {
|
||||||
* a: {
|
* a: {
|
||||||
* b: 1,
|
* b: 1
|
||||||
* },
|
* }
|
||||||
* };
|
* };
|
||||||
* const obj2 = {
|
* const obj2 = {
|
||||||
* a: {
|
* a: {
|
||||||
* b: 2,
|
* b: 2
|
||||||
* },
|
* }
|
||||||
* };
|
* };
|
||||||
* const obj3 = {
|
* const obj3 = {
|
||||||
* a: {
|
* a: {
|
||||||
* b: 1,
|
* b: 1
|
||||||
* },
|
* }
|
||||||
* };
|
* };
|
||||||
* const obj4 = { __proto__: obj1 };
|
* const obj4 = Object.create(obj1);
|
||||||
*
|
*
|
||||||
* assert.notDeepEqual(obj1, obj1);
|
* assert.notDeepEqual(obj1, obj1);
|
||||||
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
||||||
@@ -422,10 +362,10 @@ declare module "assert" {
|
|||||||
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
||||||
/**
|
/**
|
||||||
* Tests strict equality between the `actual` and `expected` parameters as
|
* Tests strict equality between the `actual` and `expected` parameters as
|
||||||
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
|
* determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.strictEqual(1, 2);
|
* assert.strictEqual(1, 2);
|
||||||
* // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
|
* // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
|
||||||
@@ -460,10 +400,10 @@ declare module "assert" {
|
|||||||
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
||||||
/**
|
/**
|
||||||
* Tests strict inequality between the `actual` and `expected` parameters as
|
* Tests strict inequality between the `actual` and `expected` parameters as
|
||||||
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
|
* determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.notStrictEqual(1, 2);
|
* assert.notStrictEqual(1, 2);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -494,7 +434,7 @@ declare module "assert" {
|
|||||||
* Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
|
* Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
|
* assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
|
||||||
* // OK
|
* // OK
|
||||||
@@ -525,14 +465,14 @@ declare module "assert" {
|
|||||||
* Custom validation object/error instance:
|
* Custom validation object/error instance:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* const err = new TypeError('Wrong value');
|
* const err = new TypeError('Wrong value');
|
||||||
* err.code = 404;
|
* err.code = 404;
|
||||||
* err.foo = 'bar';
|
* err.foo = 'bar';
|
||||||
* err.info = {
|
* err.info = {
|
||||||
* nested: true,
|
* nested: true,
|
||||||
* baz: 'text',
|
* baz: 'text'
|
||||||
* };
|
* };
|
||||||
* err.reg = /abc/i;
|
* err.reg = /abc/i;
|
||||||
*
|
*
|
||||||
@@ -545,16 +485,16 @@ declare module "assert" {
|
|||||||
* message: 'Wrong value',
|
* message: 'Wrong value',
|
||||||
* info: {
|
* info: {
|
||||||
* nested: true,
|
* nested: true,
|
||||||
* baz: 'text',
|
* baz: 'text'
|
||||||
* },
|
* }
|
||||||
* // Only properties on the validation object will be tested for.
|
* // Only properties on the validation object will be tested for.
|
||||||
* // Using nested objects requires all properties to be present. Otherwise
|
* // Using nested objects requires all properties to be present. Otherwise
|
||||||
* // the validation is going to fail.
|
* // the validation is going to fail.
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Using regular expressions to validate error properties:
|
* // Using regular expressions to validate error properties:
|
||||||
* assert.throws(
|
* throws(
|
||||||
* () => {
|
* () => {
|
||||||
* throw err;
|
* throw err;
|
||||||
* },
|
* },
|
||||||
@@ -568,17 +508,17 @@ declare module "assert" {
|
|||||||
* info: {
|
* info: {
|
||||||
* nested: true,
|
* nested: true,
|
||||||
* // It is not possible to use regular expressions for nested properties!
|
* // It is not possible to use regular expressions for nested properties!
|
||||||
* baz: 'text',
|
* baz: 'text'
|
||||||
* },
|
* },
|
||||||
* // The `reg` property contains a regular expression and only if the
|
* // The `reg` property contains a regular expression and only if the
|
||||||
* // validation object contains an identical regular expression, it is going
|
* // validation object contains an identical regular expression, it is going
|
||||||
* // to pass.
|
* // to pass.
|
||||||
* reg: /abc/i,
|
* reg: /abc/i
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Fails due to the different `message` and `name` properties:
|
* // Fails due to the different `message` and `name` properties:
|
||||||
* assert.throws(
|
* throws(
|
||||||
* () => {
|
* () => {
|
||||||
* const otherErr = new Error('Not found');
|
* const otherErr = new Error('Not found');
|
||||||
* // Copy all enumerable properties from `err` to `otherErr`.
|
* // Copy all enumerable properties from `err` to `otherErr`.
|
||||||
@@ -589,20 +529,20 @@ declare module "assert" {
|
|||||||
* },
|
* },
|
||||||
* // The error's `message` and `name` properties will also be checked when using
|
* // The error's `message` and `name` properties will also be checked when using
|
||||||
* // an error as validation object.
|
* // an error as validation object.
|
||||||
* err,
|
* err
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Validate instanceof using constructor:
|
* Validate instanceof using constructor:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.throws(
|
* assert.throws(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new Error('Wrong value');
|
* throw new Error('Wrong value');
|
||||||
* },
|
* },
|
||||||
* Error,
|
* Error
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -612,13 +552,13 @@ declare module "assert" {
|
|||||||
* therefore also include the error name.
|
* therefore also include the error name.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.throws(
|
* assert.throws(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new Error('Wrong value');
|
* throw new Error('Wrong value');
|
||||||
* },
|
* },
|
||||||
* /^Error: Wrong value$/,
|
* /^Error: Wrong value$/
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -628,7 +568,7 @@ declare module "assert" {
|
|||||||
* It will otherwise fail with an `AssertionError`.
|
* It will otherwise fail with an `AssertionError`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.throws(
|
* assert.throws(
|
||||||
* () => {
|
* () => {
|
||||||
@@ -644,7 +584,7 @@ declare module "assert" {
|
|||||||
* // possible.
|
* // possible.
|
||||||
* return true;
|
* return true;
|
||||||
* },
|
* },
|
||||||
* 'unexpected error',
|
* 'unexpected error'
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -654,7 +594,7 @@ declare module "assert" {
|
|||||||
* a string as the second argument gets considered:
|
* a string as the second argument gets considered:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* function throwingFirst() {
|
* function throwingFirst() {
|
||||||
* throw new Error('First');
|
* throw new Error('First');
|
||||||
@@ -710,20 +650,20 @@ declare module "assert" {
|
|||||||
* propagated back to the caller.
|
* propagated back to the caller.
|
||||||
*
|
*
|
||||||
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
|
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
|
||||||
* [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation
|
* [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
|
||||||
* function. See {@link throws} for more details.
|
* function. See {@link throws} for more details.
|
||||||
*
|
*
|
||||||
* The following, for instance, will throw the `TypeError` because there is no
|
* The following, for instance, will throw the `TypeError` because there is no
|
||||||
* matching error type in the assertion:
|
* matching error type in the assertion:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotThrow(
|
* assert.doesNotThrow(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* SyntaxError,
|
* SyntaxError
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -731,27 +671,27 @@ declare module "assert" {
|
|||||||
* 'Got unwanted exception...':
|
* 'Got unwanted exception...':
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotThrow(
|
* assert.doesNotThrow(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* TypeError,
|
* TypeError
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message:
|
* If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotThrow(
|
* assert.doesNotThrow(
|
||||||
* () => {
|
* () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* /Wrong value/,
|
* /Wrong value/,
|
||||||
* 'Whoops',
|
* 'Whoops'
|
||||||
* );
|
* );
|
||||||
* // Throws: AssertionError: Got unwanted exception: Whoops
|
* // Throws: AssertionError: Got unwanted exception: Whoops
|
||||||
* ```
|
* ```
|
||||||
@@ -765,7 +705,7 @@ declare module "assert" {
|
|||||||
* from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
|
* from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.ifError(null);
|
* assert.ifError(null);
|
||||||
* // OK
|
* // OK
|
||||||
@@ -811,7 +751,7 @@ declare module "assert" {
|
|||||||
* If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
|
* If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* await assert.rejects(
|
* await assert.rejects(
|
||||||
* async () => {
|
* async () => {
|
||||||
@@ -819,13 +759,13 @@ declare module "assert" {
|
|||||||
* },
|
* },
|
||||||
* {
|
* {
|
||||||
* name: 'TypeError',
|
* name: 'TypeError',
|
||||||
* message: 'Wrong value',
|
* message: 'Wrong value'
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* await assert.rejects(
|
* await assert.rejects(
|
||||||
* async () => {
|
* async () => {
|
||||||
@@ -835,16 +775,16 @@ declare module "assert" {
|
|||||||
* assert.strictEqual(err.name, 'TypeError');
|
* assert.strictEqual(err.name, 'TypeError');
|
||||||
* assert.strictEqual(err.message, 'Wrong value');
|
* assert.strictEqual(err.message, 'Wrong value');
|
||||||
* return true;
|
* return true;
|
||||||
* },
|
* }
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.rejects(
|
* assert.rejects(
|
||||||
* Promise.reject(new Error('Wrong value')),
|
* Promise.reject(new Error('Wrong value')),
|
||||||
* Error,
|
* Error
|
||||||
* ).then(() => {
|
* ).then(() => {
|
||||||
* // ...
|
* // ...
|
||||||
* });
|
* });
|
||||||
@@ -857,11 +797,7 @@ declare module "assert" {
|
|||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
||||||
function rejects(
|
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
||||||
error: AssertPredicate,
|
|
||||||
message?: string | Error,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
|
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
|
||||||
* calls the function and awaits the returned promise to complete. It will then
|
* calls the function and awaits the returned promise to complete. It will then
|
||||||
@@ -878,24 +814,24 @@ declare module "assert" {
|
|||||||
* error messages as expressive as possible.
|
* error messages as expressive as possible.
|
||||||
*
|
*
|
||||||
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
|
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
|
||||||
* [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation
|
* [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
|
||||||
* function. See {@link throws} for more details.
|
* function. See {@link throws} for more details.
|
||||||
*
|
*
|
||||||
* Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
|
* Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* await assert.doesNotReject(
|
* await assert.doesNotReject(
|
||||||
* async () => {
|
* async () => {
|
||||||
* throw new TypeError('Wrong value');
|
* throw new TypeError('Wrong value');
|
||||||
* },
|
* },
|
||||||
* SyntaxError,
|
* SyntaxError
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
|
* assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
|
||||||
* .then(() => {
|
* .then(() => {
|
||||||
@@ -904,20 +840,13 @@ declare module "assert" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
function doesNotReject(
|
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
||||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||||
message?: string | Error,
|
|
||||||
): Promise<void>;
|
|
||||||
function doesNotReject(
|
|
||||||
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
||||||
error: AssertPredicate,
|
|
||||||
message?: string | Error,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Expects the `string` input to match the regular expression.
|
* Expects the `string` input to match the regular expression.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.match('I will fail', /pass/);
|
* assert.match('I will fail', /pass/);
|
||||||
* // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
|
* // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
|
||||||
@@ -940,7 +869,7 @@ declare module "assert" {
|
|||||||
* Expects the `string` input not to match the regular expression.
|
* Expects the `string` input not to match the regular expression.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import assert from 'node:assert/strict';
|
* import assert from 'assert/strict';
|
||||||
*
|
*
|
||||||
* assert.doesNotMatch('I will fail', /fail/);
|
* assert.doesNotMatch('I will fail', /fail/);
|
||||||
* // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
|
* // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
|
||||||
@@ -959,38 +888,25 @@ declare module "assert" {
|
|||||||
* @since v13.6.0, v12.16.0
|
* @since v13.6.0, v12.16.0
|
||||||
*/
|
*/
|
||||||
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
||||||
const strict:
|
const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
|
||||||
& Omit<
|
(value: unknown, message?: string | Error): asserts value;
|
||||||
typeof assert,
|
equal: typeof strictEqual;
|
||||||
| "equal"
|
notEqual: typeof notStrictEqual;
|
||||||
| "notEqual"
|
deepEqual: typeof deepStrictEqual;
|
||||||
| "deepEqual"
|
notDeepEqual: typeof notDeepStrictEqual;
|
||||||
| "notDeepEqual"
|
// Mapped types and assertion functions are incompatible?
|
||||||
| "ok"
|
// TS2775: Assertions require every name in the call target
|
||||||
| "strictEqual"
|
// to be declared with an explicit type annotation.
|
||||||
| "deepStrictEqual"
|
ok: typeof ok;
|
||||||
| "ifError"
|
strictEqual: typeof strictEqual;
|
||||||
| "strict"
|
deepStrictEqual: typeof deepStrictEqual;
|
||||||
>
|
ifError: typeof ifError;
|
||||||
& {
|
strict: typeof strict;
|
||||||
(value: unknown, message?: string | Error): asserts value;
|
};
|
||||||
equal: typeof strictEqual;
|
|
||||||
notEqual: typeof notStrictEqual;
|
|
||||||
deepEqual: typeof deepStrictEqual;
|
|
||||||
notDeepEqual: typeof notDeepStrictEqual;
|
|
||||||
// Mapped types and assertion functions are incompatible?
|
|
||||||
// TS2775: Assertions require every name in the call target
|
|
||||||
// to be declared with an explicit type annotation.
|
|
||||||
ok: typeof ok;
|
|
||||||
strictEqual: typeof strictEqual;
|
|
||||||
deepStrictEqual: typeof deepStrictEqual;
|
|
||||||
ifError: typeof ifError;
|
|
||||||
strict: typeof strict;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
export = assert;
|
export = assert;
|
||||||
}
|
}
|
||||||
declare module "node:assert" {
|
declare module 'node:assert' {
|
||||||
import assert = require("assert");
|
import assert = require('assert');
|
||||||
export = assert;
|
export = assert;
|
||||||
}
|
}
|
||||||
|
|||||||
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Normal file → Executable file
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Normal file → Executable file
@@ -1,8 +1,8 @@
|
|||||||
declare module "assert/strict" {
|
declare module 'assert/strict' {
|
||||||
import { strict } from "node:assert";
|
import { strict } from 'node:assert';
|
||||||
export = strict;
|
export = strict;
|
||||||
}
|
}
|
||||||
declare module "node:assert/strict" {
|
declare module 'node:assert/strict' {
|
||||||
import { strict } from "node:assert";
|
import { strict } from 'node:assert';
|
||||||
export = strict;
|
export = strict;
|
||||||
}
|
}
|
||||||
|
|||||||
128
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Normal file → Executable file
128
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Normal file → Executable file
@@ -1,27 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
* We strongly discourage the use of the `async_hooks` API.
|
* The `async_hooks` module provides an API to track asynchronous resources. It
|
||||||
* Other APIs that can cover most of its use cases include:
|
* can be accessed using:
|
||||||
*
|
|
||||||
* * `AsyncLocalStorage` tracks async context
|
|
||||||
* * `process.getActiveResourcesInfo()` tracks active resources
|
|
||||||
*
|
|
||||||
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
||||||
* It can be accessed using:
|
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import async_hooks from 'node:async_hooks';
|
* import async_hooks from 'async_hooks';
|
||||||
* ```
|
* ```
|
||||||
* @experimental
|
* @experimental
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/async_hooks.js)
|
||||||
*/
|
*/
|
||||||
declare module "async_hooks" {
|
declare module 'async_hooks' {
|
||||||
/**
|
/**
|
||||||
* ```js
|
* ```js
|
||||||
* import { executionAsyncId } from 'node:async_hooks';
|
* import { executionAsyncId } from 'async_hooks';
|
||||||
* import fs from 'node:fs';
|
|
||||||
*
|
*
|
||||||
* console.log(executionAsyncId()); // 1 - bootstrap
|
* console.log(executionAsyncId()); // 1 - bootstrap
|
||||||
* const path = '.';
|
|
||||||
* fs.open(path, 'r', (err, fd) => {
|
* fs.open(path, 'r', (err, fd) => {
|
||||||
* console.log(executionAsyncId()); // 6 - open()
|
* console.log(executionAsyncId()); // 6 - open()
|
||||||
* });
|
* });
|
||||||
@@ -59,8 +51,8 @@ declare module "async_hooks" {
|
|||||||
* but having an object representing the top-level can be helpful.
|
* but having an object representing the top-level can be helpful.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs';
|
* import { open } from 'fs';
|
||||||
* import { executionAsyncId, executionAsyncResource } from 'node:async_hooks';
|
* import { executionAsyncId, executionAsyncResource } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
|
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
|
||||||
* open(new URL(import.meta.url), 'r', (err, fd) => {
|
* open(new URL(import.meta.url), 'r', (err, fd) => {
|
||||||
@@ -72,11 +64,11 @@ declare module "async_hooks" {
|
|||||||
* use of a tracking `Map` to store the metadata:
|
* use of a tracking `Map` to store the metadata:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { createServer } from 'node:http';
|
* import { createServer } from 'http';
|
||||||
* import {
|
* import {
|
||||||
* executionAsyncId,
|
* executionAsyncId,
|
||||||
* executionAsyncResource,
|
* executionAsyncResource,
|
||||||
* createHook,
|
* createHook
|
||||||
* } from 'async_hooks';
|
* } from 'async_hooks';
|
||||||
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
||||||
*
|
*
|
||||||
@@ -86,7 +78,7 @@ declare module "async_hooks" {
|
|||||||
* if (cr) {
|
* if (cr) {
|
||||||
* resource[sym] = cr[sym];
|
* resource[sym] = cr[sym];
|
||||||
* }
|
* }
|
||||||
* },
|
* }
|
||||||
* }).enable();
|
* }).enable();
|
||||||
*
|
*
|
||||||
* const server = createServer((req, res) => {
|
* const server = createServer((req, res) => {
|
||||||
@@ -175,11 +167,11 @@ declare module "async_hooks" {
|
|||||||
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { createHook } from 'node:async_hooks';
|
* import { createHook } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* const asyncHook = createHook({
|
* const asyncHook = createHook({
|
||||||
* init(asyncId, type, triggerAsyncId, resource) { },
|
* init(asyncId, type, triggerAsyncId, resource) { },
|
||||||
* destroy(asyncId) { },
|
* destroy(asyncId) { }
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -231,13 +223,13 @@ declare module "async_hooks" {
|
|||||||
* The following is an overview of the `AsyncResource` API.
|
* The following is an overview of the `AsyncResource` API.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { AsyncResource, executionAsyncId } from 'node:async_hooks';
|
* import { AsyncResource, executionAsyncId } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* // AsyncResource() is meant to be extended. Instantiating a
|
* // AsyncResource() is meant to be extended. Instantiating a
|
||||||
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
||||||
* // async_hook.executionAsyncId() is used.
|
* // async_hook.executionAsyncId() is used.
|
||||||
* const asyncResource = new AsyncResource(
|
* const asyncResource = new AsyncResource(
|
||||||
* type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },
|
* type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Run a function in the execution context of the resource. This will
|
* // Run a function in the execution context of the resource. This will
|
||||||
@@ -266,11 +258,14 @@ declare module "async_hooks" {
|
|||||||
* @param type The type of async event.
|
* @param type The type of async event.
|
||||||
* @param triggerAsyncId The ID of the execution context that created
|
* @param triggerAsyncId The ID of the execution context that created
|
||||||
* this async event (default: `executionAsyncId()`), or an
|
* this async event (default: `executionAsyncId()`), or an
|
||||||
* AsyncResourceOptions object (since v9.3.0)
|
* AsyncResourceOptions object (since 9.3)
|
||||||
*/
|
*/
|
||||||
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
||||||
/**
|
/**
|
||||||
* Binds the given function to the current execution context.
|
* Binds the given function to the current execution context.
|
||||||
|
*
|
||||||
|
* The returned function will have an `asyncResource` property referencing
|
||||||
|
* the `AsyncResource` to which the function is bound.
|
||||||
* @since v14.8.0, v12.19.0
|
* @since v14.8.0, v12.19.0
|
||||||
* @param fn The function to bind to the current execution context.
|
* @param fn The function to bind to the current execution context.
|
||||||
* @param type An optional name to associate with the underlying `AsyncResource`.
|
* @param type An optional name to associate with the underlying `AsyncResource`.
|
||||||
@@ -278,14 +273,23 @@ declare module "async_hooks" {
|
|||||||
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
||||||
fn: Func,
|
fn: Func,
|
||||||
type?: string,
|
type?: string,
|
||||||
thisArg?: ThisArg,
|
thisArg?: ThisArg
|
||||||
): Func;
|
): Func & {
|
||||||
|
asyncResource: AsyncResource;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Binds the given function to execute to this `AsyncResource`'s scope.
|
* Binds the given function to execute to this `AsyncResource`'s scope.
|
||||||
|
*
|
||||||
|
* The returned function will have an `asyncResource` property referencing
|
||||||
|
* the `AsyncResource` to which the function is bound.
|
||||||
* @since v14.8.0, v12.19.0
|
* @since v14.8.0, v12.19.0
|
||||||
* @param fn The function to bind to the current `AsyncResource`.
|
* @param fn The function to bind to the current `AsyncResource`.
|
||||||
*/
|
*/
|
||||||
bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
bind<Func extends (...args: any[]) => any>(
|
||||||
|
fn: Func
|
||||||
|
): Func & {
|
||||||
|
asyncResource: AsyncResource;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Call the provided function with the provided arguments in the execution context
|
* Call the provided function with the provided arguments in the execution context
|
||||||
* of the async resource. This will establish the context, trigger the AsyncHooks
|
* of the async resource. This will establish the context, trigger the AsyncHooks
|
||||||
@@ -296,11 +300,7 @@ declare module "async_hooks" {
|
|||||||
* @param thisArg The receiver to be used for the function call.
|
* @param thisArg The receiver to be used for the function call.
|
||||||
* @param args Optional arguments to pass to the function.
|
* @param args Optional arguments to pass to the function.
|
||||||
*/
|
*/
|
||||||
runInAsyncScope<This, Result>(
|
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
||||||
fn: (this: This, ...args: any[]) => Result,
|
|
||||||
thisArg?: This,
|
|
||||||
...args: any[]
|
|
||||||
): Result;
|
|
||||||
/**
|
/**
|
||||||
* Call all `destroy` hooks. This should only ever be called once. An error will
|
* Call all `destroy` hooks. This should only ever be called once. An error will
|
||||||
* be thrown if it is called more than once. This **must** be manually called. If
|
* be thrown if it is called more than once. This **must** be manually called. If
|
||||||
@@ -314,6 +314,7 @@ declare module "async_hooks" {
|
|||||||
*/
|
*/
|
||||||
asyncId(): number;
|
asyncId(): number;
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
||||||
*/
|
*/
|
||||||
triggerAsyncId(): number;
|
triggerAsyncId(): number;
|
||||||
@@ -321,17 +322,17 @@ declare module "async_hooks" {
|
|||||||
/**
|
/**
|
||||||
* This class creates stores that stay coherent through asynchronous operations.
|
* This class creates stores that stay coherent through asynchronous operations.
|
||||||
*
|
*
|
||||||
* While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory
|
* While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe
|
||||||
* safe implementation that involves significant optimizations that are non-obvious
|
* implementation that involves significant optimizations that are non-obvious to
|
||||||
* to implement.
|
* implement.
|
||||||
*
|
*
|
||||||
* The following example uses `AsyncLocalStorage` to build a simple logger
|
* The following example uses `AsyncLocalStorage` to build a simple logger
|
||||||
* that assigns IDs to incoming HTTP requests and includes them in messages
|
* that assigns IDs to incoming HTTP requests and includes them in messages
|
||||||
* logged within each request.
|
* logged within each request.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import http from 'node:http';
|
* import http from 'http';
|
||||||
* import { AsyncLocalStorage } from 'node:async_hooks';
|
* import { AsyncLocalStorage } from 'async_hooks';
|
||||||
*
|
*
|
||||||
* const asyncLocalStorage = new AsyncLocalStorage();
|
* const asyncLocalStorage = new AsyncLocalStorage();
|
||||||
*
|
*
|
||||||
@@ -363,48 +364,10 @@ declare module "async_hooks" {
|
|||||||
*
|
*
|
||||||
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
|
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
|
||||||
* Multiple instances can safely exist simultaneously without risk of interfering
|
* Multiple instances can safely exist simultaneously without risk of interfering
|
||||||
* with each other's data.
|
* with each other data.
|
||||||
* @since v13.10.0, v12.17.0
|
* @since v13.10.0, v12.17.0
|
||||||
*/
|
*/
|
||||||
class AsyncLocalStorage<T> {
|
class AsyncLocalStorage<T> {
|
||||||
/**
|
|
||||||
* Binds the given function to the current execution context.
|
|
||||||
* @since v19.8.0
|
|
||||||
* @experimental
|
|
||||||
* @param fn The function to bind to the current execution context.
|
|
||||||
* @return A new function that calls `fn` within the captured execution context.
|
|
||||||
*/
|
|
||||||
static bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
|
||||||
/**
|
|
||||||
* Captures the current execution context and returns a function that accepts a
|
|
||||||
* function as an argument. Whenever the returned function is called, it
|
|
||||||
* calls the function passed to it within the captured context.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* const asyncLocalStorage = new AsyncLocalStorage();
|
|
||||||
* const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());
|
|
||||||
* const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));
|
|
||||||
* console.log(result); // returns 123
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple
|
|
||||||
* async context tracking purposes, for example:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* class Foo {
|
|
||||||
* #runInAsyncScope = AsyncLocalStorage.snapshot();
|
|
||||||
*
|
|
||||||
* get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); }
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* const foo = asyncLocalStorage.run(123, () => new Foo());
|
|
||||||
* console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
|
|
||||||
* ```
|
|
||||||
* @since v19.8.0
|
|
||||||
* @experimental
|
|
||||||
* @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
|
|
||||||
*/
|
|
||||||
static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;
|
|
||||||
/**
|
/**
|
||||||
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
|
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
|
||||||
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
|
* to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
|
||||||
@@ -432,9 +395,8 @@ declare module "async_hooks" {
|
|||||||
getStore(): T | undefined;
|
getStore(): T | undefined;
|
||||||
/**
|
/**
|
||||||
* Runs a function synchronously within a context and returns its
|
* Runs a function synchronously within a context and returns its
|
||||||
* return value. The store is not accessible outside of the callback function.
|
* return value. The store is not accessible outside of the callback function or
|
||||||
* The store is accessible to any asynchronous operations created within the
|
* the asynchronous operations created within the callback.
|
||||||
* callback.
|
|
||||||
*
|
*
|
||||||
* The optional `args` are passed to the callback function.
|
* The optional `args` are passed to the callback function.
|
||||||
*
|
*
|
||||||
@@ -448,9 +410,6 @@ declare module "async_hooks" {
|
|||||||
* try {
|
* try {
|
||||||
* asyncLocalStorage.run(store, () => {
|
* asyncLocalStorage.run(store, () => {
|
||||||
* asyncLocalStorage.getStore(); // Returns the store object
|
* asyncLocalStorage.getStore(); // Returns the store object
|
||||||
* setTimeout(() => {
|
|
||||||
* asyncLocalStorage.getStore(); // Returns the store object
|
|
||||||
* }, 200);
|
|
||||||
* throw new Error();
|
* throw new Error();
|
||||||
* });
|
* });
|
||||||
* } catch (e) {
|
* } catch (e) {
|
||||||
@@ -460,7 +419,6 @@ declare module "async_hooks" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v13.10.0, v12.17.0
|
* @since v13.10.0, v12.17.0
|
||||||
*/
|
*/
|
||||||
run<R>(store: T, callback: () => R): R;
|
|
||||||
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
|
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
|
||||||
/**
|
/**
|
||||||
* Runs a function synchronously outside of a context and returns its
|
* Runs a function synchronously outside of a context and returns its
|
||||||
@@ -534,6 +492,6 @@ declare module "async_hooks" {
|
|||||||
enterWith(store: T): void;
|
enterWith(store: T): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:async_hooks" {
|
declare module 'node:async_hooks' {
|
||||||
export * from "async_hooks";
|
export * from 'async_hooks';
|
||||||
}
|
}
|
||||||
|
|||||||
486
node_modules/@types/node/buffer.d.ts
generated
vendored
Normal file → Executable file
486
node_modules/@types/node/buffer.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
530
node_modules/@types/node/child_process.d.ts
generated
vendored
Normal file → Executable file
530
node_modules/@types/node/child_process.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
252
node_modules/@types/node/cluster.d.ts
generated
vendored
Normal file → Executable file
252
node_modules/@types/node/cluster.d.ts
generated
vendored
Normal file → Executable file
@@ -1,19 +1,18 @@
|
|||||||
/**
|
/**
|
||||||
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
* A single instance of Node.js runs in a single thread. To take advantage of
|
||||||
* that can distribute workloads among their application threads. When process
|
* multi-core systems, the user will sometimes want to launch a cluster of Node.js
|
||||||
* isolation is not needed, use the `worker_threads` module instead, which
|
* processes to handle the load.
|
||||||
* allows running multiple application threads within a single Node.js instance.
|
|
||||||
*
|
*
|
||||||
* The cluster module allows easy creation of child processes that all share
|
* The cluster module allows easy creation of child processes that all share
|
||||||
* server ports.
|
* server ports.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import cluster from 'node:cluster';
|
* import cluster from 'cluster';
|
||||||
* import http from 'node:http';
|
* import http from 'http';
|
||||||
* import { availableParallelism } from 'node:os';
|
* import { cpus } from 'os';
|
||||||
* import process from 'node:process';
|
* import process from 'process';
|
||||||
*
|
*
|
||||||
* const numCPUs = availableParallelism();
|
* const numCPUs = cpus().length;
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* console.log(`Primary ${process.pid} is running`);
|
* console.log(`Primary ${process.pid} is running`);
|
||||||
@@ -50,13 +49,12 @@
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/cluster.js)
|
||||||
*/
|
*/
|
||||||
declare module "cluster" {
|
declare module 'cluster' {
|
||||||
import * as child from "node:child_process";
|
import * as child from 'node:child_process';
|
||||||
import EventEmitter = require("node:events");
|
import EventEmitter = require('node:events');
|
||||||
import * as net from "node:net";
|
import * as net from 'node:net';
|
||||||
type SerializationType = "json" | "advanced";
|
|
||||||
export interface ClusterSettings {
|
export interface ClusterSettings {
|
||||||
execArgv?: string[] | undefined; // default: process.execArgv
|
execArgv?: string[] | undefined; // default: process.execArgv
|
||||||
exec?: string | undefined;
|
exec?: string | undefined;
|
||||||
@@ -66,14 +64,11 @@ declare module "cluster" {
|
|||||||
uid?: number | undefined;
|
uid?: number | undefined;
|
||||||
gid?: number | undefined;
|
gid?: number | undefined;
|
||||||
inspectPort?: number | (() => number) | undefined;
|
inspectPort?: number | (() => number) | undefined;
|
||||||
serialization?: SerializationType | undefined;
|
|
||||||
cwd?: string | undefined;
|
|
||||||
windowsHide?: boolean | undefined;
|
|
||||||
}
|
}
|
||||||
export interface Address {
|
export interface Address {
|
||||||
address: string;
|
address: string;
|
||||||
port: number;
|
port: number;
|
||||||
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6"
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* A `Worker` object contains all public information and method about a worker.
|
* A `Worker` object contains all public information and method about a worker.
|
||||||
@@ -104,9 +99,9 @@ declare module "cluster" {
|
|||||||
/**
|
/**
|
||||||
* Send a message to a worker or primary, optionally with a handle.
|
* Send a message to a worker or primary, optionally with a handle.
|
||||||
*
|
*
|
||||||
* In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`.
|
* In the primary this sends a message to a specific worker. It is identical to `ChildProcess.send()`.
|
||||||
*
|
*
|
||||||
* In a worker, this sends a message to the primary. It is identical to`process.send()`.
|
* In a worker this sends a message to the primary. It is identical to`process.send()`.
|
||||||
*
|
*
|
||||||
* This example will echo back all messages from the primary:
|
* This example will echo back all messages from the primary:
|
||||||
*
|
*
|
||||||
@@ -125,25 +120,22 @@ declare module "cluster" {
|
|||||||
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
|
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
|
||||||
*/
|
*/
|
||||||
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
||||||
send(
|
send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean;
|
||||||
message: child.Serializable,
|
send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean;
|
||||||
sendHandle: child.SendHandle,
|
|
||||||
callback?: (error: Error | null) => void,
|
|
||||||
): boolean;
|
|
||||||
send(
|
|
||||||
message: child.Serializable,
|
|
||||||
sendHandle: child.SendHandle,
|
|
||||||
options?: child.MessageOptions,
|
|
||||||
callback?: (error: Error | null) => void,
|
|
||||||
): boolean;
|
|
||||||
/**
|
/**
|
||||||
* This function will kill the worker. In the primary worker, it does this by
|
* This function will kill the worker. In the primary, it does this
|
||||||
* disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
|
* by disconnecting the `worker.process`, and once disconnected, killing
|
||||||
|
* with `signal`. In the worker, it does it by disconnecting the channel,
|
||||||
|
* and then exiting with code `0`.
|
||||||
*
|
*
|
||||||
* The `kill()` function kills the worker process without waiting for a graceful
|
* Because `kill()` attempts to gracefully disconnect the worker process, it is
|
||||||
* disconnect, it has the same behavior as `worker.process.kill()`.
|
* susceptible to waiting indefinitely for the disconnect to complete. For example,
|
||||||
|
* if the worker enters an infinite loop, a graceful disconnect will never occur.
|
||||||
|
* If the graceful disconnect behavior is not needed, use `worker.process.kill()`.
|
||||||
*
|
*
|
||||||
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
* Causes `.exitedAfterDisconnect` to be set.
|
||||||
|
*
|
||||||
|
* This method is aliased as `worker.destroy()` for backward compatibility.
|
||||||
*
|
*
|
||||||
* In a worker, `process.kill()` exists, but it is not this function;
|
* In a worker, `process.kill()` exists, but it is not this function;
|
||||||
* it is `kill()`.
|
* it is `kill()`.
|
||||||
@@ -196,7 +188,7 @@ declare module "cluster" {
|
|||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* } else if (cluster.isWorker) {
|
* } else if (cluster.isWorker) {
|
||||||
* const net = require('node:net');
|
* const net = require('net');
|
||||||
* const server = net.createServer((socket) => {
|
* const server = net.createServer((socket) => {
|
||||||
* // Connections never end
|
* // Connections never end
|
||||||
* });
|
* });
|
||||||
@@ -226,12 +218,12 @@ declare module "cluster" {
|
|||||||
* because of exiting or being signaled). Otherwise, it returns `false`.
|
* because of exiting or being signaled). Otherwise, it returns `false`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import cluster from 'node:cluster';
|
* import cluster from 'cluster';
|
||||||
* import http from 'node:http';
|
* import http from 'http';
|
||||||
* import { availableParallelism } from 'node:os';
|
* import { cpus } from 'os';
|
||||||
* import process from 'node:process';
|
* import process from 'process';
|
||||||
*
|
*
|
||||||
* const numCPUs = availableParallelism();
|
* const numCPUs = cpus().length;
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* console.log(`Primary ${process.pid} is running`);
|
* console.log(`Primary ${process.pid} is running`);
|
||||||
@@ -261,8 +253,7 @@ declare module "cluster" {
|
|||||||
*/
|
*/
|
||||||
isDead(): boolean;
|
isDead(): boolean;
|
||||||
/**
|
/**
|
||||||
* This property is `true` if the worker exited due to `.disconnect()`.
|
* This property is `true` if the worker exited due to `.kill()` or`.disconnect()`. If the worker exited any other way, it is `false`. If the
|
||||||
* If the worker exited any other way, it is `false`. If the
|
|
||||||
* worker has not exited, it is `undefined`.
|
* worker has not exited, it is `undefined`.
|
||||||
*
|
*
|
||||||
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
|
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
|
||||||
@@ -292,47 +283,47 @@ declare module "cluster" {
|
|||||||
* 6. online
|
* 6. online
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "disconnect", listener: () => void): this;
|
addListener(event: 'disconnect', listener: () => void): this;
|
||||||
addListener(event: "error", listener: (error: Error) => void): this;
|
addListener(event: 'error', listener: (error: Error) => void): this;
|
||||||
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
addListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
addListener(event: "listening", listener: (address: Address) => void): this;
|
addListener(event: 'listening', listener: (address: Address) => void): this;
|
||||||
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
addListener(event: "online", listener: () => void): this;
|
addListener(event: 'online', listener: () => void): this;
|
||||||
emit(event: string | symbol, ...args: any[]): boolean;
|
emit(event: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "disconnect"): boolean;
|
emit(event: 'disconnect'): boolean;
|
||||||
emit(event: "error", error: Error): boolean;
|
emit(event: 'error', error: Error): boolean;
|
||||||
emit(event: "exit", code: number, signal: string): boolean;
|
emit(event: 'exit', code: number, signal: string): boolean;
|
||||||
emit(event: "listening", address: Address): boolean;
|
emit(event: 'listening', address: Address): boolean;
|
||||||
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
|
emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean;
|
||||||
emit(event: "online"): boolean;
|
emit(event: 'online'): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "disconnect", listener: () => void): this;
|
on(event: 'disconnect', listener: () => void): this;
|
||||||
on(event: "error", listener: (error: Error) => void): this;
|
on(event: 'error', listener: (error: Error) => void): this;
|
||||||
on(event: "exit", listener: (code: number, signal: string) => void): this;
|
on(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
on(event: "listening", listener: (address: Address) => void): this;
|
on(event: 'listening', listener: (address: Address) => void): this;
|
||||||
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
on(event: "online", listener: () => void): this;
|
on(event: 'online', listener: () => void): this;
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "disconnect", listener: () => void): this;
|
once(event: 'disconnect', listener: () => void): this;
|
||||||
once(event: "error", listener: (error: Error) => void): this;
|
once(event: 'error', listener: (error: Error) => void): this;
|
||||||
once(event: "exit", listener: (code: number, signal: string) => void): this;
|
once(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
once(event: "listening", listener: (address: Address) => void): this;
|
once(event: 'listening', listener: (address: Address) => void): this;
|
||||||
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
once(event: "online", listener: () => void): this;
|
once(event: 'online', listener: () => void): this;
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "disconnect", listener: () => void): this;
|
prependListener(event: 'disconnect', listener: () => void): this;
|
||||||
prependListener(event: "error", listener: (error: Error) => void): this;
|
prependListener(event: 'error', listener: (error: Error) => void): this;
|
||||||
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
prependListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
prependListener(event: "listening", listener: (address: Address) => void): this;
|
prependListener(event: 'listening', listener: (address: Address) => void): this;
|
||||||
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
prependListener(event: "online", listener: () => void): this;
|
prependListener(event: 'online', listener: () => void): this;
|
||||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
prependOnceListener(event: 'disconnect', listener: () => void): this;
|
||||||
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
prependOnceListener(event: 'error', listener: (error: Error) => void): this;
|
||||||
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
|
prependOnceListener(event: 'listening', listener: (address: Address) => void): this;
|
||||||
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
prependOnceListener(event: "online", listener: () => void): this;
|
prependOnceListener(event: 'online', listener: () => void): this;
|
||||||
}
|
}
|
||||||
export interface Cluster extends EventEmitter {
|
export interface Cluster extends EventEmitter {
|
||||||
disconnect(callback?: () => void): void;
|
disconnect(callback?: () => void): void;
|
||||||
@@ -364,69 +355,60 @@ declare module "cluster" {
|
|||||||
* 7. setup
|
* 7. setup
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
addListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
addListener(event: "fork", listener: (worker: Worker) => void): this;
|
addListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
addListener(
|
addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
event: "message",
|
addListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
||||||
addListener(event: "online", listener: (worker: Worker) => void): this;
|
|
||||||
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
||||||
emit(event: string | symbol, ...args: any[]): boolean;
|
emit(event: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "disconnect", worker: Worker): boolean;
|
emit(event: 'disconnect', worker: Worker): boolean;
|
||||||
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
emit(event: 'exit', worker: Worker, code: number, signal: string): boolean;
|
||||||
emit(event: "fork", worker: Worker): boolean;
|
emit(event: 'fork', worker: Worker): boolean;
|
||||||
emit(event: "listening", worker: Worker, address: Address): boolean;
|
emit(event: 'listening', worker: Worker, address: Address): boolean;
|
||||||
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
||||||
emit(event: "online", worker: Worker): boolean;
|
emit(event: 'online', worker: Worker): boolean;
|
||||||
emit(event: "setup", settings: ClusterSettings): boolean;
|
emit(event: 'setup', settings: ClusterSettings): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "disconnect", listener: (worker: Worker) => void): this;
|
on(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
on(event: "fork", listener: (worker: Worker) => void): this;
|
on(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
on(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
on(event: "online", listener: (worker: Worker) => void): this;
|
on(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
on(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "disconnect", listener: (worker: Worker) => void): this;
|
once(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
once(event: "fork", listener: (worker: Worker) => void): this;
|
once(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
once(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||||
once(event: "online", listener: (worker: Worker) => void): this;
|
once(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
once(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
prependListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
prependListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
// the handle is a net.Socket or net.Server object, or undefined.
|
// the handle is a net.Socket or net.Server object, or undefined.
|
||||||
prependListener(
|
prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this;
|
||||||
event: "message",
|
prependListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
|
prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
): this;
|
|
||||||
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
||||||
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
||||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||||
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||||
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
|
prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||||
// the handle is a net.Socket or net.Server object, or undefined.
|
// the handle is a net.Socket or net.Server object, or undefined.
|
||||||
prependOnceListener(
|
prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
||||||
event: "message",
|
prependOnceListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||||
): this;
|
|
||||||
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
|
|
||||||
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
||||||
}
|
}
|
||||||
const cluster: Cluster;
|
const cluster: Cluster;
|
||||||
export default cluster;
|
export default cluster;
|
||||||
}
|
}
|
||||||
declare module "node:cluster" {
|
declare module 'node:cluster' {
|
||||||
export * from "cluster";
|
export * from 'cluster';
|
||||||
export { default as default } from "cluster";
|
export { default as default } from 'cluster';
|
||||||
}
|
}
|
||||||
|
|||||||
41
node_modules/@types/node/console.d.ts
generated
vendored
Normal file → Executable file
41
node_modules/@types/node/console.d.ts
generated
vendored
Normal file → Executable file
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:console` module provides a simple debugging console that is similar to
|
* The `console` module provides a simple debugging console that is similar to the
|
||||||
* the JavaScript console mechanism provided by web browsers.
|
* JavaScript console mechanism provided by web browsers.
|
||||||
*
|
*
|
||||||
* The module exports two specific components:
|
* The module exports two specific components:
|
||||||
*
|
*
|
||||||
* * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream.
|
* * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream.
|
||||||
* * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`.
|
* * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`.
|
||||||
*
|
*
|
||||||
* _**Warning**_: The global console object's methods are neither consistently
|
* _**Warning**_: The global console object's methods are neither consistently
|
||||||
* synchronous like the browser APIs they resemble, nor are they consistently
|
* synchronous like the browser APIs they resemble, nor are they consistently
|
||||||
@@ -53,14 +53,14 @@
|
|||||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||||
* // Prints: Danger Will Robinson! Danger!, to err
|
* // Prints: Danger Will Robinson! Danger!, to err
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/console.js)
|
||||||
*/
|
*/
|
||||||
declare module "console" {
|
declare module 'console' {
|
||||||
import console = require("node:console");
|
import console = require('node:console');
|
||||||
export = console;
|
export = console;
|
||||||
}
|
}
|
||||||
declare module "node:console" {
|
declare module 'node:console' {
|
||||||
import { InspectOptions } from "node:util";
|
import { InspectOptions } from 'node:util';
|
||||||
global {
|
global {
|
||||||
// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
|
// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
|
||||||
interface Console {
|
interface Console {
|
||||||
@@ -123,7 +123,7 @@ declare module "node:console" {
|
|||||||
* >
|
* >
|
||||||
* ```
|
* ```
|
||||||
* @since v8.3.0
|
* @since v8.3.0
|
||||||
* @param [label='default'] The display label for the counter.
|
* @param label The display label for the counter.
|
||||||
*/
|
*/
|
||||||
count(label?: string): void;
|
count(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -141,7 +141,7 @@ declare module "node:console" {
|
|||||||
* >
|
* >
|
||||||
* ```
|
* ```
|
||||||
* @since v8.3.0
|
* @since v8.3.0
|
||||||
* @param [label='default'] The display label for the counter.
|
* @param label The display label for the counter.
|
||||||
*/
|
*/
|
||||||
countReset(label?: string): void;
|
countReset(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -221,7 +221,7 @@ declare module "node:console" {
|
|||||||
log(message?: any, ...optionalParams: any[]): void;
|
log(message?: any, ...optionalParams: any[]): void;
|
||||||
/**
|
/**
|
||||||
* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
* Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
||||||
* logging the argument if it can't be parsed as tabular.
|
* logging the argument if it can’t be parsed as tabular.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* // These can't be parsed as tabular data
|
* // These can't be parsed as tabular data
|
||||||
@@ -257,7 +257,6 @@ declare module "node:console" {
|
|||||||
* suitable time units to `stdout`. For example, if the elapsed
|
* suitable time units to `stdout`. For example, if the elapsed
|
||||||
* time is 3869ms, `console.timeEnd()` displays "3.869s".
|
* time is 3869ms, `console.timeEnd()` displays "3.869s".
|
||||||
* @since v0.1.104
|
* @since v0.1.104
|
||||||
* @param [label='default']
|
|
||||||
*/
|
*/
|
||||||
time(label?: string): void;
|
time(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -265,13 +264,12 @@ declare module "node:console" {
|
|||||||
* prints the result to `stdout`:
|
* prints the result to `stdout`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* console.time('bunch-of-stuff');
|
* console.time('100-elements');
|
||||||
* // Do a bunch of stuff.
|
* for (let i = 0; i < 100; i++) {}
|
||||||
* console.timeEnd('bunch-of-stuff');
|
* console.timeEnd('100-elements');
|
||||||
* // Prints: bunch-of-stuff: 225.438ms
|
* // prints 100-elements: 225.438ms
|
||||||
* ```
|
* ```
|
||||||
* @since v0.1.104
|
* @since v0.1.104
|
||||||
* @param [label='default']
|
|
||||||
*/
|
*/
|
||||||
timeEnd(label?: string): void;
|
timeEnd(label?: string): void;
|
||||||
/**
|
/**
|
||||||
@@ -287,7 +285,6 @@ declare module "node:console" {
|
|||||||
* console.timeEnd('process');
|
* console.timeEnd('process');
|
||||||
* ```
|
* ```
|
||||||
* @since v10.7.0
|
* @since v10.7.0
|
||||||
* @param [label='default']
|
|
||||||
*/
|
*/
|
||||||
timeLog(label?: string, ...data: any[]): void;
|
timeLog(label?: string, ...data: any[]): void;
|
||||||
/**
|
/**
|
||||||
@@ -395,7 +392,7 @@ declare module "node:console" {
|
|||||||
stdout: NodeJS.WritableStream;
|
stdout: NodeJS.WritableStream;
|
||||||
stderr?: NodeJS.WritableStream | undefined;
|
stderr?: NodeJS.WritableStream | undefined;
|
||||||
ignoreErrors?: boolean | undefined;
|
ignoreErrors?: boolean | undefined;
|
||||||
colorMode?: boolean | "auto" | undefined;
|
colorMode?: boolean | 'auto' | undefined;
|
||||||
inspectOptions?: InspectOptions | undefined;
|
inspectOptions?: InspectOptions | undefined;
|
||||||
/**
|
/**
|
||||||
* Set group indentation
|
* Set group indentation
|
||||||
@@ -405,8 +402,8 @@ declare module "node:console" {
|
|||||||
}
|
}
|
||||||
interface ConsoleConstructor {
|
interface ConsoleConstructor {
|
||||||
prototype: Console;
|
prototype: Console;
|
||||||
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
||||||
new(options: ConsoleConstructorOptions): Console;
|
new (options: ConsoleConstructorOptions): Console;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var console: Console;
|
var console: Console;
|
||||||
|
|||||||
23
node_modules/@types/node/constants.d.ts
generated
vendored
Normal file → Executable file
23
node_modules/@types/node/constants.d.ts
generated
vendored
Normal file → Executable file
@@ -1,19 +1,18 @@
|
|||||||
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
||||||
declare module "constants" {
|
declare module 'constants' {
|
||||||
import { constants as osConstants, SignalConstants } from "node:os";
|
import { constants as osConstants, SignalConstants } from 'node:os';
|
||||||
import { constants as cryptoConstants } from "node:crypto";
|
import { constants as cryptoConstants } from 'node:crypto';
|
||||||
import { constants as fsConstants } from "node:fs";
|
import { constants as fsConstants } from 'node:fs';
|
||||||
|
|
||||||
const exp:
|
const exp: typeof osConstants.errno &
|
||||||
& typeof osConstants.errno
|
typeof osConstants.priority &
|
||||||
& typeof osConstants.priority
|
SignalConstants &
|
||||||
& SignalConstants
|
typeof cryptoConstants &
|
||||||
& typeof cryptoConstants
|
typeof fsConstants;
|
||||||
& typeof fsConstants;
|
|
||||||
export = exp;
|
export = exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "node:constants" {
|
declare module 'node:constants' {
|
||||||
import constants = require("constants");
|
import constants = require('constants');
|
||||||
export = constants;
|
export = constants;
|
||||||
}
|
}
|
||||||
|
|||||||
2119
node_modules/@types/node/crypto.d.ts
generated
vendored
Normal file → Executable file
2119
node_modules/@types/node/crypto.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
165
node_modules/@types/node/dgram.d.ts
generated
vendored
Normal file → Executable file
165
node_modules/@types/node/dgram.d.ts
generated
vendored
Normal file → Executable file
@@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:dgram` module provides an implementation of UDP datagram sockets.
|
* The `dgram` module provides an implementation of UDP datagram sockets.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
*
|
*
|
||||||
* const server = dgram.createSocket('udp4');
|
* const server = dgram.createSocket('udp4');
|
||||||
*
|
*
|
||||||
* server.on('error', (err) => {
|
* server.on('error', (err) => {
|
||||||
* console.error(`server error:\n${err.stack}`);
|
* console.log(`server error:\n${err.stack}`);
|
||||||
* server.close();
|
* server.close();
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
@@ -23,15 +23,15 @@
|
|||||||
* server.bind(41234);
|
* server.bind(41234);
|
||||||
* // Prints: server listening 0.0.0.0:41234
|
* // Prints: server listening 0.0.0.0:41234
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dgram.js)
|
||||||
*/
|
*/
|
||||||
declare module "dgram" {
|
declare module 'dgram' {
|
||||||
import { AddressInfo } from "node:net";
|
import { AddressInfo } from 'node:net';
|
||||||
import * as dns from "node:dns";
|
import * as dns from 'node:dns';
|
||||||
import { Abortable, EventEmitter } from "node:events";
|
import { EventEmitter, Abortable } from 'node:events';
|
||||||
interface RemoteInfo {
|
interface RemoteInfo {
|
||||||
address: string;
|
address: string;
|
||||||
family: "IPv4" | "IPv6";
|
family: 'IPv4' | 'IPv6';
|
||||||
port: number;
|
port: number;
|
||||||
size: number;
|
size: number;
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ declare module "dgram" {
|
|||||||
exclusive?: boolean | undefined;
|
exclusive?: boolean | undefined;
|
||||||
fd?: number | undefined;
|
fd?: number | undefined;
|
||||||
}
|
}
|
||||||
type SocketType = "udp4" | "udp6";
|
type SocketType = 'udp4' | 'udp6';
|
||||||
interface SocketOptions extends Abortable {
|
interface SocketOptions extends Abortable {
|
||||||
type: SocketType;
|
type: SocketType;
|
||||||
reuseAddr?: boolean | undefined;
|
reuseAddr?: boolean | undefined;
|
||||||
@@ -51,13 +51,7 @@ declare module "dgram" {
|
|||||||
ipv6Only?: boolean | undefined;
|
ipv6Only?: boolean | undefined;
|
||||||
recvBufferSize?: number | undefined;
|
recvBufferSize?: number | undefined;
|
||||||
sendBufferSize?: number | undefined;
|
sendBufferSize?: number | undefined;
|
||||||
lookup?:
|
lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined;
|
||||||
| ((
|
|
||||||
hostname: string,
|
|
||||||
options: dns.LookupOneOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
|
||||||
) => void)
|
|
||||||
| undefined;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
|
* Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
|
||||||
@@ -104,8 +98,8 @@ declare module "dgram" {
|
|||||||
* When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur:
|
* When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import cluster from 'node:cluster';
|
* import cluster from 'cluster';
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
*
|
*
|
||||||
* if (cluster.isPrimary) {
|
* if (cluster.isPrimary) {
|
||||||
* cluster.fork(); // Works ok.
|
* cluster.fork(); // Works ok.
|
||||||
@@ -122,7 +116,7 @@ declare module "dgram" {
|
|||||||
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||||
/**
|
/**
|
||||||
* Returns an object containing the address information for a socket.
|
* Returns an object containing the address information for a socket.
|
||||||
* For UDP sockets, this object will contain `address`, `family`, and `port`properties.
|
* For UDP sockets, this object will contain `address`, `family` and `port`properties.
|
||||||
*
|
*
|
||||||
* This method throws `EBADF` if called on an unbound socket.
|
* This method throws `EBADF` if called on an unbound socket.
|
||||||
* @since v0.1.99
|
* @since v0.1.99
|
||||||
@@ -148,12 +142,12 @@ declare module "dgram" {
|
|||||||
* Example of a UDP server listening on port 41234:
|
* Example of a UDP server listening on port 41234:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
*
|
*
|
||||||
* const server = dgram.createSocket('udp4');
|
* const server = dgram.createSocket('udp4');
|
||||||
*
|
*
|
||||||
* server.on('error', (err) => {
|
* server.on('error', (err) => {
|
||||||
* console.error(`server error:\n${err.stack}`);
|
* console.log(`server error:\n${err.stack}`);
|
||||||
* server.close();
|
* server.close();
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
@@ -266,7 +260,7 @@ declare module "dgram" {
|
|||||||
*
|
*
|
||||||
* The `address` argument is a string. If the value of `address` is a host name,
|
* The `address` argument is a string. If the value of `address` is a host name,
|
||||||
* DNS will be used to resolve the address of the host. If `address` is not
|
* DNS will be used to resolve the address of the host. If `address` is not
|
||||||
* provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default.
|
* provided or otherwise falsy, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default.
|
||||||
*
|
*
|
||||||
* If the socket has not been previously bound with a call to `bind`, the socket
|
* If the socket has not been previously bound with a call to `bind`, the socket
|
||||||
* is assigned a random port number and is bound to the "all interfaces" address
|
* is assigned a random port number and is bound to the "all interfaces" address
|
||||||
@@ -290,8 +284,8 @@ declare module "dgram" {
|
|||||||
* Example of sending a UDP packet to a port on `localhost`;
|
* Example of sending a UDP packet to a port on `localhost`;
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* const message = Buffer.from('Some bytes');
|
* const message = Buffer.from('Some bytes');
|
||||||
* const client = dgram.createSocket('udp4');
|
* const client = dgram.createSocket('udp4');
|
||||||
@@ -303,8 +297,8 @@ declare module "dgram" {
|
|||||||
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* const buf1 = Buffer.from('Some ');
|
* const buf1 = Buffer.from('Some ');
|
||||||
* const buf2 = Buffer.from('bytes');
|
* const buf2 = Buffer.from('bytes');
|
||||||
@@ -322,8 +316,8 @@ declare module "dgram" {
|
|||||||
* Example of sending a UDP packet using a socket connected to a port on`localhost`:
|
* Example of sending a UDP packet using a socket connected to a port on`localhost`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import dgram from 'node:dgram';
|
* import dgram from 'dgram';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* const message = Buffer.from('Some bytes');
|
* const message = Buffer.from('Some bytes');
|
||||||
* const client = dgram.createSocket('udp4');
|
* const client = dgram.createSocket('udp4');
|
||||||
@@ -341,42 +335,12 @@ declare module "dgram" {
|
|||||||
* @param address Destination host name or IP address.
|
* @param address Destination host name or IP address.
|
||||||
* @param callback Called when the message has been sent.
|
* @param callback Called when the message has been sent.
|
||||||
*/
|
*/
|
||||||
send(
|
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
port?: number,
|
send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
address?: string,
|
send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
): void;
|
send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||||
send(
|
|
||||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
|
||||||
port?: number,
|
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
|
||||||
): void;
|
|
||||||
send(
|
|
||||||
msg: string | Uint8Array | ReadonlyArray<any>,
|
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
|
||||||
): void;
|
|
||||||
send(
|
|
||||||
msg: string | Uint8Array,
|
|
||||||
offset: number,
|
|
||||||
length: number,
|
|
||||||
port?: number,
|
|
||||||
address?: string,
|
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
|
||||||
): void;
|
|
||||||
send(
|
|
||||||
msg: string | Uint8Array,
|
|
||||||
offset: number,
|
|
||||||
length: number,
|
|
||||||
port?: number,
|
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
|
||||||
): void;
|
|
||||||
send(
|
|
||||||
msg: string | Uint8Array,
|
|
||||||
offset: number,
|
|
||||||
length: number,
|
|
||||||
callback?: (error: Error | null, bytes: number) => void,
|
|
||||||
): void;
|
|
||||||
/**
|
/**
|
||||||
* Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
|
* Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
|
||||||
* packets may be sent to a local interface's broadcast address.
|
* packets may be sent to a local interface's broadcast address.
|
||||||
@@ -487,7 +451,7 @@ declare module "dgram" {
|
|||||||
* TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
|
* TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
|
||||||
* Changing TTL values is typically done for network probes or when multicasting.
|
* Changing TTL values is typically done for network probes or when multicasting.
|
||||||
*
|
*
|
||||||
* The `ttl` argument may be between 1 and 255\. The default on most systems
|
* The `ttl` argument may be between between 1 and 255\. The default on most systems
|
||||||
* is 64.
|
* is 64.
|
||||||
*
|
*
|
||||||
* This method throws `EBADF` if called on an unbound socket.
|
* This method throws `EBADF` if called on an unbound socket.
|
||||||
@@ -539,48 +503,43 @@ declare module "dgram" {
|
|||||||
* 5. message
|
* 5. message
|
||||||
*/
|
*/
|
||||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
addListener(event: "close", listener: () => void): this;
|
addListener(event: 'close', listener: () => void): this;
|
||||||
addListener(event: "connect", listener: () => void): this;
|
addListener(event: 'connect', listener: () => void): this;
|
||||||
addListener(event: "error", listener: (err: Error) => void): this;
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
addListener(event: "listening", listener: () => void): this;
|
addListener(event: 'listening', listener: () => void): this;
|
||||||
addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
emit(event: string | symbol, ...args: any[]): boolean;
|
emit(event: string | symbol, ...args: any[]): boolean;
|
||||||
emit(event: "close"): boolean;
|
emit(event: 'close'): boolean;
|
||||||
emit(event: "connect"): boolean;
|
emit(event: 'connect'): boolean;
|
||||||
emit(event: "error", err: Error): boolean;
|
emit(event: 'error', err: Error): boolean;
|
||||||
emit(event: "listening"): boolean;
|
emit(event: 'listening'): boolean;
|
||||||
emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
|
emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean;
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
on(event: "close", listener: () => void): this;
|
on(event: 'close', listener: () => void): this;
|
||||||
on(event: "connect", listener: () => void): this;
|
on(event: 'connect', listener: () => void): this;
|
||||||
on(event: "error", listener: (err: Error) => void): this;
|
on(event: 'error', listener: (err: Error) => void): this;
|
||||||
on(event: "listening", listener: () => void): this;
|
on(event: 'listening', listener: () => void): this;
|
||||||
on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
once(event: string, listener: (...args: any[]) => void): this;
|
once(event: string, listener: (...args: any[]) => void): this;
|
||||||
once(event: "close", listener: () => void): this;
|
once(event: 'close', listener: () => void): this;
|
||||||
once(event: "connect", listener: () => void): this;
|
once(event: 'connect', listener: () => void): this;
|
||||||
once(event: "error", listener: (err: Error) => void): this;
|
once(event: 'error', listener: (err: Error) => void): this;
|
||||||
once(event: "listening", listener: () => void): this;
|
once(event: 'listening', listener: () => void): this;
|
||||||
once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependListener(event: "close", listener: () => void): this;
|
prependListener(event: 'close', listener: () => void): this;
|
||||||
prependListener(event: "connect", listener: () => void): this;
|
prependListener(event: 'connect', listener: () => void): this;
|
||||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependListener(event: "listening", listener: () => void): this;
|
prependListener(event: 'listening', listener: () => void): this;
|
||||||
prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||||
prependOnceListener(event: "close", listener: () => void): this;
|
prependOnceListener(event: 'close', listener: () => void): this;
|
||||||
prependOnceListener(event: "connect", listener: () => void): this;
|
prependOnceListener(event: 'connect', listener: () => void): this;
|
||||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
||||||
prependOnceListener(event: "listening", listener: () => void): this;
|
prependOnceListener(event: 'listening', listener: () => void): this;
|
||||||
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||||
/**
|
|
||||||
* Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
|
|
||||||
* @since v20.5.0
|
|
||||||
*/
|
|
||||||
[Symbol.asyncDispose](): Promise<void>;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:dgram" {
|
declare module 'node:dgram' {
|
||||||
export * from "dgram";
|
export * from 'dgram';
|
||||||
}
|
}
|
||||||
|
|||||||
95
node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
Normal file → Executable file
95
node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
Normal file → Executable file
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:diagnostics_channel` module provides an API to create named channels
|
* The `diagnostics_channel` module provides an API to create named channels
|
||||||
* to report arbitrary message data for diagnostics purposes.
|
* to report arbitrary message data for diagnostics purposes.
|
||||||
*
|
*
|
||||||
* It can be accessed using:
|
* It can be accessed using:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* It is intended that a module writer wanting to report diagnostics messages
|
* It is intended that a module writer wanting to report diagnostics messages
|
||||||
@@ -19,10 +19,10 @@
|
|||||||
* channels are used along with the shape of the message data. Channel names
|
* channels are used along with the shape of the message data. Channel names
|
||||||
* should generally include the module name to avoid collisions with data from
|
* should generally include the module name to avoid collisions with data from
|
||||||
* other modules.
|
* other modules.
|
||||||
* @since v15.1.0, v14.17.0
|
* @experimental
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/diagnostics_channel.js)
|
||||||
*/
|
*/
|
||||||
declare module "diagnostics_channel" {
|
declare module 'diagnostics_channel' {
|
||||||
/**
|
/**
|
||||||
* Check if there are active subscribers to the named channel. This is helpful if
|
* Check if there are active subscribers to the named channel. This is helpful if
|
||||||
* the message you want to send might be expensive to prepare.
|
* the message you want to send might be expensive to prepare.
|
||||||
@@ -31,7 +31,7 @@ declare module "diagnostics_channel" {
|
|||||||
* performance-sensitive code.
|
* performance-sensitive code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* if (diagnostics_channel.hasSubscribers('my-channel')) {
|
* if (diagnostics_channel.hasSubscribers('my-channel')) {
|
||||||
* // There are subscribers, prepare and publish message
|
* // There are subscribers, prepare and publish message
|
||||||
@@ -41,14 +41,14 @@ declare module "diagnostics_channel" {
|
|||||||
* @param name The channel name
|
* @param name The channel name
|
||||||
* @return If there are active subscribers
|
* @return If there are active subscribers
|
||||||
*/
|
*/
|
||||||
function hasSubscribers(name: string | symbol): boolean;
|
function hasSubscribers(name: string): boolean;
|
||||||
/**
|
/**
|
||||||
* This is the primary entry-point for anyone wanting to publish to a named
|
* This is the primary entry-point for anyone wanting to interact with a named
|
||||||
* channel. It produces a channel object which is optimized to reduce overhead at
|
* channel. It produces a channel object which is optimized to reduce overhead at
|
||||||
* publish time as much as possible.
|
* publish time as much as possible.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
* ```
|
* ```
|
||||||
@@ -56,48 +56,11 @@ declare module "diagnostics_channel" {
|
|||||||
* @param name The channel name
|
* @param name The channel name
|
||||||
* @return The named channel object
|
* @return The named channel object
|
||||||
*/
|
*/
|
||||||
function channel(name: string | symbol): Channel;
|
function channel(name: string): Channel;
|
||||||
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
type ChannelListener = (name: string, message: unknown) => void;
|
||||||
/**
|
|
||||||
* Register a message handler to subscribe to this channel. This message handler
|
|
||||||
* will be run synchronously whenever a message is published to the channel. Any
|
|
||||||
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
|
||||||
*
|
|
||||||
* diagnostics_channel.subscribe('my-channel', (message, name) => {
|
|
||||||
* // Received data
|
|
||||||
* });
|
|
||||||
* ```
|
|
||||||
* @since v18.7.0, v16.17.0
|
|
||||||
* @param name The channel name
|
|
||||||
* @param onMessage The handler to receive channel messages
|
|
||||||
*/
|
|
||||||
function subscribe(name: string | symbol, onMessage: ChannelListener): void;
|
|
||||||
/**
|
|
||||||
* Remove a message handler previously registered to this channel with {@link subscribe}.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
|
||||||
*
|
|
||||||
* function onMessage(message, name) {
|
|
||||||
* // Received data
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* diagnostics_channel.subscribe('my-channel', onMessage);
|
|
||||||
*
|
|
||||||
* diagnostics_channel.unsubscribe('my-channel', onMessage);
|
|
||||||
* ```
|
|
||||||
* @since v18.7.0, v16.17.0
|
|
||||||
* @param name The channel name
|
|
||||||
* @param onMessage The previous subscribed handler to remove
|
|
||||||
* @return `true` if the handler was found, `false` otherwise.
|
|
||||||
*/
|
|
||||||
function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
|
|
||||||
/**
|
/**
|
||||||
* The class `Channel` represents an individual named channel within the data
|
* The class `Channel` represents an individual named channel within the data
|
||||||
* pipeline. It is used to track subscribers and to publish messages when there
|
* pipeline. It is use to track subscribers and to publish messages when there
|
||||||
* are subscribers present. It exists as a separate object to avoid channel
|
* are subscribers present. It exists as a separate object to avoid channel
|
||||||
* lookups at publish time, enabling very fast publish speeds and allowing
|
* lookups at publish time, enabling very fast publish speeds and allowing
|
||||||
* for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
|
* for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
|
||||||
@@ -105,7 +68,7 @@ declare module "diagnostics_channel" {
|
|||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0, v14.17.0
|
||||||
*/
|
*/
|
||||||
class Channel {
|
class Channel {
|
||||||
readonly name: string | symbol;
|
readonly name: string;
|
||||||
/**
|
/**
|
||||||
* Check if there are active subscribers to this channel. This is helpful if
|
* Check if there are active subscribers to this channel. This is helpful if
|
||||||
* the message you want to send might be expensive to prepare.
|
* the message you want to send might be expensive to prepare.
|
||||||
@@ -114,7 +77,7 @@ declare module "diagnostics_channel" {
|
|||||||
* performance-sensitive code.
|
* performance-sensitive code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
*
|
*
|
||||||
@@ -125,31 +88,14 @@ declare module "diagnostics_channel" {
|
|||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0, v14.17.0
|
||||||
*/
|
*/
|
||||||
readonly hasSubscribers: boolean;
|
readonly hasSubscribers: boolean;
|
||||||
private constructor(name: string | symbol);
|
private constructor(name: string);
|
||||||
/**
|
|
||||||
* Publish a message to any subscribers to the channel. This will trigger
|
|
||||||
* message handlers synchronously so they will execute within the same context.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
|
||||||
*
|
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
|
||||||
*
|
|
||||||
* channel.publish({
|
|
||||||
* some: 'message',
|
|
||||||
* });
|
|
||||||
* ```
|
|
||||||
* @since v15.1.0, v14.17.0
|
|
||||||
* @param message The message to send to the channel subscribers
|
|
||||||
*/
|
|
||||||
publish(message: unknown): void;
|
|
||||||
/**
|
/**
|
||||||
* Register a message handler to subscribe to this channel. This message handler
|
* Register a message handler to subscribe to this channel. This message handler
|
||||||
* will be run synchronously whenever a message is published to the channel. Any
|
* will be run synchronously whenever a message is published to the channel. Any
|
||||||
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
* errors thrown in the message handler will trigger an `'uncaughtException'`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
*
|
*
|
||||||
@@ -158,7 +104,6 @@ declare module "diagnostics_channel" {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0, v14.17.0
|
||||||
* @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)}
|
|
||||||
* @param onMessage The handler to receive channel messages
|
* @param onMessage The handler to receive channel messages
|
||||||
*/
|
*/
|
||||||
subscribe(onMessage: ChannelListener): void;
|
subscribe(onMessage: ChannelListener): void;
|
||||||
@@ -166,7 +111,7 @@ declare module "diagnostics_channel" {
|
|||||||
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import diagnostics_channel from 'node:diagnostics_channel';
|
* import diagnostics_channel from 'diagnostics_channel';
|
||||||
*
|
*
|
||||||
* const channel = diagnostics_channel.channel('my-channel');
|
* const channel = diagnostics_channel.channel('my-channel');
|
||||||
*
|
*
|
||||||
@@ -179,13 +124,11 @@ declare module "diagnostics_channel" {
|
|||||||
* channel.unsubscribe(onMessage);
|
* channel.unsubscribe(onMessage);
|
||||||
* ```
|
* ```
|
||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0, v14.17.0
|
||||||
* @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)}
|
|
||||||
* @param onMessage The previous subscribed handler to remove
|
* @param onMessage The previous subscribed handler to remove
|
||||||
* @return `true` if the handler was found, `false` otherwise.
|
|
||||||
*/
|
*/
|
||||||
unsubscribe(onMessage: ChannelListener): void;
|
unsubscribe(onMessage: ChannelListener): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:diagnostics_channel" {
|
declare module 'node:diagnostics_channel' {
|
||||||
export * from "diagnostics_channel";
|
export * from 'diagnostics_channel';
|
||||||
}
|
}
|
||||||
|
|||||||
327
node_modules/@types/node/dns.d.ts
generated
vendored
Normal file → Executable file
327
node_modules/@types/node/dns.d.ts
generated
vendored
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* The `node:dns` module enables name resolution. For example, use it to look up IP
|
* The `dns` module enables name resolution. For example, use it to look up IP
|
||||||
* addresses of host names.
|
* addresses of host names.
|
||||||
*
|
*
|
||||||
* Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the
|
* Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
* system do, use {@link lookup}.
|
* system do, use {@link lookup}.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
*
|
*
|
||||||
* dns.lookup('example.org', (err, address, family) => {
|
* dns.lookup('example.org', (err, address, family) => {
|
||||||
* console.log('address: %j family: IPv%s', address, family);
|
* console.log('address: %j family: IPv%s', address, family);
|
||||||
@@ -17,13 +17,13 @@
|
|||||||
* // address: "93.184.216.34" family: IPv4
|
* // address: "93.184.216.34" family: IPv4
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* All other functions in the `node:dns` module connect to an actual DNS server to
|
* All other functions in the `dns` module connect to an actual DNS server to
|
||||||
* perform name resolution. They will always use the network to perform DNS
|
* perform name resolution. They will always use the network to perform DNS
|
||||||
* queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform
|
* queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform
|
||||||
* DNS queries, bypassing other name-resolution facilities.
|
* DNS queries, bypassing other name-resolution facilities.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
*
|
*
|
||||||
* dns.resolve4('archive.org', (err, addresses) => {
|
* dns.resolve4('archive.org', (err, addresses) => {
|
||||||
* if (err) throw err;
|
* if (err) throw err;
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* See the `Implementation considerations section` for more information.
|
* See the `Implementation considerations section` for more information.
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dns.js)
|
||||||
*/
|
*/
|
||||||
declare module "dns" {
|
declare module 'dns' {
|
||||||
import * as dnsPromises from "node:dns/promises";
|
import * as dnsPromises from 'node:dns/promises';
|
||||||
// Supported getaddrinfo flags.
|
// Supported getaddrinfo flags.
|
||||||
export const ADDRCONFIG: number;
|
export const ADDRCONFIG: number;
|
||||||
export const V4MAPPED: number;
|
export const V4MAPPED: number;
|
||||||
@@ -58,9 +58,6 @@ declare module "dns" {
|
|||||||
family?: number | undefined;
|
family?: number | undefined;
|
||||||
hints?: number | undefined;
|
hints?: number | undefined;
|
||||||
all?: boolean | undefined;
|
all?: boolean | undefined;
|
||||||
/**
|
|
||||||
* @default true
|
|
||||||
*/
|
|
||||||
verbatim?: boolean | undefined;
|
verbatim?: boolean | undefined;
|
||||||
}
|
}
|
||||||
export interface LookupOneOptions extends LookupOptions {
|
export interface LookupOneOptions extends LookupOptions {
|
||||||
@@ -76,8 +73,8 @@ declare module "dns" {
|
|||||||
/**
|
/**
|
||||||
* Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
|
* Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
|
||||||
* AAAA (IPv6) record. All `option` properties are optional. If `options` is an
|
* AAAA (IPv6) record. All `option` properties are optional. If `options` is an
|
||||||
* integer, then it must be `4` or `6` – if `options` is `0` or not provided, then
|
* integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
|
||||||
* IPv4 and IPv6 addresses are both returned if found.
|
* and IPv6 addresses are both returned if found.
|
||||||
*
|
*
|
||||||
* With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the
|
* With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the
|
||||||
* properties `address` and `family`.
|
* properties `address` and `family`.
|
||||||
@@ -89,14 +86,14 @@ declare module "dns" {
|
|||||||
*
|
*
|
||||||
* `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
|
* `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
|
||||||
* The implementation uses an operating system facility that can associate names
|
* The implementation uses an operating system facility that can associate names
|
||||||
* with addresses and vice versa. This implementation can have subtle but
|
* with addresses, and vice versa. This implementation can have subtle but
|
||||||
* important consequences on the behavior of any Node.js program. Please take some
|
* important consequences on the behavior of any Node.js program. Please take some
|
||||||
* time to consult the `Implementation considerations section` before using`dns.lookup()`.
|
* time to consult the `Implementation considerations section` before using`dns.lookup()`.
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
* const options = {
|
* const options = {
|
||||||
* family: 6,
|
* family: 6,
|
||||||
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
||||||
@@ -115,30 +112,11 @@ declare module "dns" {
|
|||||||
* If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties.
|
* If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties.
|
||||||
* @since v0.1.90
|
* @since v0.1.90
|
||||||
*/
|
*/
|
||||||
export function lookup(
|
export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||||
hostname: string,
|
export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||||
family: number,
|
export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
|
||||||
): void;
|
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||||
export function lookup(
|
|
||||||
hostname: string,
|
|
||||||
options: LookupOneOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
|
||||||
): void;
|
|
||||||
export function lookup(
|
|
||||||
hostname: string,
|
|
||||||
options: LookupAllOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
|
|
||||||
): void;
|
|
||||||
export function lookup(
|
|
||||||
hostname: string,
|
|
||||||
options: LookupOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void,
|
|
||||||
): void;
|
|
||||||
export function lookup(
|
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
|
||||||
): void;
|
|
||||||
export namespace lookup {
|
export namespace lookup {
|
||||||
function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
||||||
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
|
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
|
||||||
@@ -154,7 +132,7 @@ declare module "dns" {
|
|||||||
* On an error, `err` is an `Error` object, where `err.code` is the error code.
|
* On an error, `err` is an `Error` object, where `err.code` is the error code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
||||||
* console.log(hostname, service);
|
* console.log(hostname, service);
|
||||||
* // Prints: localhost ssh
|
* // Prints: localhost ssh
|
||||||
@@ -164,15 +142,11 @@ declare module "dns" {
|
|||||||
* If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties.
|
* If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties.
|
||||||
* @since v0.11.14
|
* @since v0.11.14
|
||||||
*/
|
*/
|
||||||
export function lookupService(
|
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
|
||||||
address: string,
|
|
||||||
port: number,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
|
|
||||||
): void;
|
|
||||||
export namespace lookupService {
|
export namespace lookupService {
|
||||||
function __promisify__(
|
function __promisify__(
|
||||||
address: string,
|
address: string,
|
||||||
port: number,
|
port: number
|
||||||
): Promise<{
|
): Promise<{
|
||||||
hostname: string;
|
hostname: string;
|
||||||
service: string;
|
service: string;
|
||||||
@@ -191,13 +165,13 @@ declare module "dns" {
|
|||||||
/** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
|
/** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
|
||||||
export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
|
export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
|
||||||
export interface AnyARecord extends RecordWithTtl {
|
export interface AnyARecord extends RecordWithTtl {
|
||||||
type: "A";
|
type: 'A';
|
||||||
}
|
}
|
||||||
export interface AnyAaaaRecord extends RecordWithTtl {
|
export interface AnyAaaaRecord extends RecordWithTtl {
|
||||||
type: "AAAA";
|
type: 'AAAA';
|
||||||
}
|
}
|
||||||
export interface CaaRecord {
|
export interface CaaRecord {
|
||||||
critical: number;
|
critial: number;
|
||||||
issue?: string | undefined;
|
issue?: string | undefined;
|
||||||
issuewild?: string | undefined;
|
issuewild?: string | undefined;
|
||||||
iodef?: string | undefined;
|
iodef?: string | undefined;
|
||||||
@@ -209,7 +183,7 @@ declare module "dns" {
|
|||||||
exchange: string;
|
exchange: string;
|
||||||
}
|
}
|
||||||
export interface AnyMxRecord extends MxRecord {
|
export interface AnyMxRecord extends MxRecord {
|
||||||
type: "MX";
|
type: 'MX';
|
||||||
}
|
}
|
||||||
export interface NaptrRecord {
|
export interface NaptrRecord {
|
||||||
flags: string;
|
flags: string;
|
||||||
@@ -220,7 +194,7 @@ declare module "dns" {
|
|||||||
preference: number;
|
preference: number;
|
||||||
}
|
}
|
||||||
export interface AnyNaptrRecord extends NaptrRecord {
|
export interface AnyNaptrRecord extends NaptrRecord {
|
||||||
type: "NAPTR";
|
type: 'NAPTR';
|
||||||
}
|
}
|
||||||
export interface SoaRecord {
|
export interface SoaRecord {
|
||||||
nsname: string;
|
nsname: string;
|
||||||
@@ -232,7 +206,7 @@ declare module "dns" {
|
|||||||
minttl: number;
|
minttl: number;
|
||||||
}
|
}
|
||||||
export interface AnySoaRecord extends SoaRecord {
|
export interface AnySoaRecord extends SoaRecord {
|
||||||
type: "SOA";
|
type: 'SOA';
|
||||||
}
|
}
|
||||||
export interface SrvRecord {
|
export interface SrvRecord {
|
||||||
priority: number;
|
priority: number;
|
||||||
@@ -241,35 +215,25 @@ declare module "dns" {
|
|||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
export interface AnySrvRecord extends SrvRecord {
|
export interface AnySrvRecord extends SrvRecord {
|
||||||
type: "SRV";
|
type: 'SRV';
|
||||||
}
|
}
|
||||||
export interface AnyTxtRecord {
|
export interface AnyTxtRecord {
|
||||||
type: "TXT";
|
type: 'TXT';
|
||||||
entries: string[];
|
entries: string[];
|
||||||
}
|
}
|
||||||
export interface AnyNsRecord {
|
export interface AnyNsRecord {
|
||||||
type: "NS";
|
type: 'NS';
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
export interface AnyPtrRecord {
|
export interface AnyPtrRecord {
|
||||||
type: "PTR";
|
type: 'PTR';
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
export interface AnyCnameRecord {
|
export interface AnyCnameRecord {
|
||||||
type: "CNAME";
|
type: 'CNAME';
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
export type AnyRecord =
|
export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord;
|
||||||
| AnyARecord
|
|
||||||
| AnyAaaaRecord
|
|
||||||
| AnyCnameRecord
|
|
||||||
| AnyMxRecord
|
|
||||||
| AnyNaptrRecord
|
|
||||||
| AnyNsRecord
|
|
||||||
| AnyPtrRecord
|
|
||||||
| AnySoaRecord
|
|
||||||
| AnySrvRecord
|
|
||||||
| AnyTxtRecord;
|
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
|
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
|
||||||
* of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
|
* of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
|
||||||
@@ -282,85 +246,32 @@ declare module "dns" {
|
|||||||
* @param hostname Host name to resolve.
|
* @param hostname Host name to resolve.
|
||||||
* @param [rrtype='A'] Resource record type.
|
* @param [rrtype='A'] Resource record type.
|
||||||
*/
|
*/
|
||||||
export function resolve(
|
export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
): void;
|
export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
|
||||||
export function resolve(
|
export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
||||||
rrtype: "A",
|
export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
): void;
|
export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
export function resolve(
|
export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
|
||||||
hostname: string,
|
export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||||
rrtype: "AAAA",
|
export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "ANY",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "CNAME",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "MX",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "NAPTR",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "NS",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "PTR",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "SOA",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "SRV",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
|
||||||
hostname: string,
|
|
||||||
rrtype: "TXT",
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve(
|
export function resolve(
|
||||||
hostname: string,
|
hostname: string,
|
||||||
rrtype: string,
|
rrtype: string,
|
||||||
callback: (
|
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void
|
||||||
err: NodeJS.ErrnoException | null,
|
|
||||||
addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
|
|
||||||
) => void,
|
|
||||||
): void;
|
): void;
|
||||||
export namespace resolve {
|
export namespace resolve {
|
||||||
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
function __promisify__(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
|
||||||
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
function __promisify__(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
||||||
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
function __promisify__(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
||||||
function __promisify__(
|
function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||||
hostname: string,
|
|
||||||
rrtype: string,
|
|
||||||
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
||||||
@@ -368,45 +279,23 @@ declare module "dns" {
|
|||||||
* @since v0.1.16
|
* @since v0.1.16
|
||||||
* @param hostname Host name to resolve.
|
* @param hostname Host name to resolve.
|
||||||
*/
|
*/
|
||||||
export function resolve4(
|
export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
|
||||||
): void;
|
|
||||||
export function resolve4(
|
|
||||||
hostname: string,
|
|
||||||
options: ResolveWithTtlOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve4(
|
|
||||||
hostname: string,
|
|
||||||
options: ResolveOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolve4 {
|
export namespace resolve4 {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||||
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
* Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function
|
||||||
* will contain an array of IPv6 addresses.
|
* will contain an array of IPv6 addresses.
|
||||||
* @since v0.1.16
|
* @since v0.1.16
|
||||||
* @param hostname Host name to resolve.
|
* @param hostname Host name to resolve.
|
||||||
*/
|
*/
|
||||||
export function resolve6(
|
export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
|
||||||
): void;
|
|
||||||
export function resolve6(
|
|
||||||
hostname: string,
|
|
||||||
options: ResolveWithTtlOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
|
|
||||||
): void;
|
|
||||||
export function resolve6(
|
|
||||||
hostname: string,
|
|
||||||
options: ResolveOptions,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolve6 {
|
export namespace resolve6 {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||||
@@ -417,10 +306,7 @@ declare module "dns" {
|
|||||||
* will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
|
* will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
|
||||||
* @since v0.3.2
|
* @since v0.3.2
|
||||||
*/
|
*/
|
||||||
export function resolveCname(
|
export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveCname {
|
export namespace resolveCname {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
}
|
}
|
||||||
@@ -428,12 +314,9 @@ declare module "dns" {
|
|||||||
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
|
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
|
||||||
* will contain an array of certification authority authorization records
|
* will contain an array of certification authority authorization records
|
||||||
* available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
|
* available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
|
||||||
* @since v15.0.0, v14.17.0
|
* @since v15.0.0
|
||||||
*/
|
*/
|
||||||
export function resolveCaa(
|
export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveCaa {
|
export namespace resolveCaa {
|
||||||
function __promisify__(hostname: string): Promise<CaaRecord[]>;
|
function __promisify__(hostname: string): Promise<CaaRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -442,15 +325,12 @@ declare module "dns" {
|
|||||||
* contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
|
* contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
|
||||||
* @since v0.1.27
|
* @since v0.1.27
|
||||||
*/
|
*/
|
||||||
export function resolveMx(
|
export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveMx {
|
export namespace resolveMx {
|
||||||
function __promisify__(hostname: string): Promise<MxRecord[]>;
|
function __promisify__(hostname: string): Promise<MxRecord[]>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of
|
* Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of
|
||||||
* objects with the following properties:
|
* objects with the following properties:
|
||||||
*
|
*
|
||||||
* * `flags`
|
* * `flags`
|
||||||
@@ -472,10 +352,7 @@ declare module "dns" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v0.9.12
|
* @since v0.9.12
|
||||||
*/
|
*/
|
||||||
export function resolveNaptr(
|
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveNaptr {
|
export namespace resolveNaptr {
|
||||||
function __promisify__(hostname: string): Promise<NaptrRecord[]>;
|
function __promisify__(hostname: string): Promise<NaptrRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -484,10 +361,7 @@ declare module "dns" {
|
|||||||
* contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
|
* contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
|
||||||
* @since v0.1.90
|
* @since v0.1.90
|
||||||
*/
|
*/
|
||||||
export function resolveNs(
|
export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveNs {
|
export namespace resolveNs {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
}
|
}
|
||||||
@@ -496,10 +370,7 @@ declare module "dns" {
|
|||||||
* be an array of strings containing the reply records.
|
* be an array of strings containing the reply records.
|
||||||
* @since v6.0.0
|
* @since v6.0.0
|
||||||
*/
|
*/
|
||||||
export function resolvePtr(
|
export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolvePtr {
|
export namespace resolvePtr {
|
||||||
function __promisify__(hostname: string): Promise<string[]>;
|
function __promisify__(hostname: string): Promise<string[]>;
|
||||||
}
|
}
|
||||||
@@ -529,10 +400,7 @@ declare module "dns" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v0.11.10
|
* @since v0.11.10
|
||||||
*/
|
*/
|
||||||
export function resolveSoa(
|
export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveSoa {
|
export namespace resolveSoa {
|
||||||
function __promisify__(hostname: string): Promise<SoaRecord>;
|
function __promisify__(hostname: string): Promise<SoaRecord>;
|
||||||
}
|
}
|
||||||
@@ -555,10 +423,7 @@ declare module "dns" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v0.1.27
|
* @since v0.1.27
|
||||||
*/
|
*/
|
||||||
export function resolveSrv(
|
export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveSrv {
|
export namespace resolveSrv {
|
||||||
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -569,10 +434,7 @@ declare module "dns" {
|
|||||||
* treated separately.
|
* treated separately.
|
||||||
* @since v0.1.27
|
* @since v0.1.27
|
||||||
*/
|
*/
|
||||||
export function resolveTxt(
|
export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveTxt {
|
export namespace resolveTxt {
|
||||||
function __promisify__(hostname: string): Promise<string[][]>;
|
function __promisify__(hostname: string): Promise<string[][]>;
|
||||||
}
|
}
|
||||||
@@ -606,10 +468,7 @@ declare module "dns" {
|
|||||||
* DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC
|
* DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC
|
||||||
* 8482](https://tools.ietf.org/html/rfc8482).
|
* 8482](https://tools.ietf.org/html/rfc8482).
|
||||||
*/
|
*/
|
||||||
export function resolveAny(
|
export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
|
||||||
hostname: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
|
|
||||||
): void;
|
|
||||||
export namespace resolveAny {
|
export namespace resolveAny {
|
||||||
function __promisify__(hostname: string): Promise<AnyRecord[]>;
|
function __promisify__(hostname: string): Promise<AnyRecord[]>;
|
||||||
}
|
}
|
||||||
@@ -621,18 +480,7 @@ declare module "dns" {
|
|||||||
* one of the `DNS error codes`.
|
* one of the `DNS error codes`.
|
||||||
* @since v0.1.16
|
* @since v0.1.16
|
||||||
*/
|
*/
|
||||||
export function reverse(
|
export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
|
||||||
ip: string,
|
|
||||||
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
|
||||||
): void;
|
|
||||||
/**
|
|
||||||
* Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
|
|
||||||
*
|
|
||||||
* * `ipv4first`: for `verbatim` defaulting to `false`.
|
|
||||||
* * `verbatim`: for `verbatim` defaulting to `true`.
|
|
||||||
* @since v20.1.0
|
|
||||||
*/
|
|
||||||
export function getDefaultResultOrder(): "ipv4first" | "verbatim";
|
|
||||||
/**
|
/**
|
||||||
* Sets the IP address and port of servers to be used when performing DNS
|
* Sets the IP address and port of servers to be used when performing DNS
|
||||||
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
|
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
|
||||||
@@ -679,18 +527,16 @@ declare module "dns" {
|
|||||||
*/
|
*/
|
||||||
export function getServers(): string[];
|
export function getServers(): string[];
|
||||||
/**
|
/**
|
||||||
* Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
|
* Set the default value of `verbatim` in {@link lookup}. The value could be:
|
||||||
|
* - `ipv4first`: sets default `verbatim` `false`.
|
||||||
|
* - `verbatim`: sets default `verbatim` `true`.
|
||||||
*
|
*
|
||||||
* * `ipv4first`: sets default `verbatim` `false`.
|
* The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
|
||||||
* * `verbatim`: sets default `verbatim` `true`.
|
* When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
|
||||||
*
|
* @since v14.18.0
|
||||||
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
* @param order must be 'ipv4first' or 'verbatim'.
|
||||||
* priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default
|
|
||||||
* dns orders in workers.
|
|
||||||
* @since v16.4.0, v14.18.0
|
|
||||||
* @param order must be `'ipv4first'` or `'verbatim'`.
|
|
||||||
*/
|
*/
|
||||||
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
|
||||||
// Error codes
|
// Error codes
|
||||||
export const NODATA: string;
|
export const NODATA: string;
|
||||||
export const FORMERR: string;
|
export const FORMERR: string;
|
||||||
@@ -731,7 +577,7 @@ declare module "dns" {
|
|||||||
* other resolvers:
|
* other resolvers:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const { Resolver } = require('node:dns');
|
* const { Resolver } = require('dns');
|
||||||
* const resolver = new Resolver();
|
* const resolver = new Resolver();
|
||||||
* resolver.setServers(['4.4.4.4']);
|
* resolver.setServers(['4.4.4.4']);
|
||||||
*
|
*
|
||||||
@@ -741,7 +587,7 @@ declare module "dns" {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The following methods from the `node:dns` module are available:
|
* The following methods from the `dns` module are available:
|
||||||
*
|
*
|
||||||
* * `resolver.getServers()`
|
* * `resolver.getServers()`
|
||||||
* * `resolver.resolve()`
|
* * `resolver.resolve()`
|
||||||
@@ -774,7 +620,6 @@ declare module "dns" {
|
|||||||
resolve4: typeof resolve4;
|
resolve4: typeof resolve4;
|
||||||
resolve6: typeof resolve6;
|
resolve6: typeof resolve6;
|
||||||
resolveAny: typeof resolveAny;
|
resolveAny: typeof resolveAny;
|
||||||
resolveCaa: typeof resolveCaa;
|
|
||||||
resolveCname: typeof resolveCname;
|
resolveCname: typeof resolveCname;
|
||||||
resolveMx: typeof resolveMx;
|
resolveMx: typeof resolveMx;
|
||||||
resolveNaptr: typeof resolveNaptr;
|
resolveNaptr: typeof resolveNaptr;
|
||||||
@@ -789,13 +634,13 @@ declare module "dns" {
|
|||||||
* This allows programs to specify outbound interfaces when used on multi-homed
|
* This allows programs to specify outbound interfaces when used on multi-homed
|
||||||
* systems.
|
* systems.
|
||||||
*
|
*
|
||||||
* If a v4 or v6 address is not specified, it is set to the default and the
|
* If a v4 or v6 address is not specified, it is set to the default, and the
|
||||||
* operating system will choose a local address automatically.
|
* operating system will choose a local address automatically.
|
||||||
*
|
*
|
||||||
* The resolver will use the v4 local address when making requests to IPv4 DNS
|
* The resolver will use the v4 local address when making requests to IPv4 DNS
|
||||||
* servers, and the v6 local address when making requests to IPv6 DNS servers.
|
* servers, and the v6 local address when making requests to IPv6 DNS servers.
|
||||||
* The `rrtype` of resolution requests has no impact on the local address used.
|
* The `rrtype` of resolution requests has no impact on the local address used.
|
||||||
* @since v15.1.0, v14.17.0
|
* @since v15.1.0
|
||||||
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
|
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
|
||||||
* @param [ipv6='::0'] A string representation of an IPv6 address.
|
* @param [ipv6='::0'] A string representation of an IPv6 address.
|
||||||
*/
|
*/
|
||||||
@@ -804,6 +649,6 @@ declare module "dns" {
|
|||||||
}
|
}
|
||||||
export { dnsPromises as promises };
|
export { dnsPromises as promises };
|
||||||
}
|
}
|
||||||
declare module "node:dns" {
|
declare module 'node:dns' {
|
||||||
export * from "dns";
|
export * from 'dns';
|
||||||
}
|
}
|
||||||
|
|||||||
127
node_modules/@types/node/dns/promises.d.ts
generated
vendored
Normal file → Executable file
127
node_modules/@types/node/dns/promises.d.ts
generated
vendored
Normal file → Executable file
@@ -1,26 +1,26 @@
|
|||||||
/**
|
/**
|
||||||
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
|
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
|
||||||
* that return `Promise` objects rather than using callbacks. The API is accessible
|
* that return `Promise` objects rather than using callbacks. The API is accessible
|
||||||
* via `require('node:dns').promises` or `require('node:dns/promises')`.
|
* via `require('dns').promises` or `require('dns/promises')`.
|
||||||
* @since v10.6.0
|
* @since v10.6.0
|
||||||
*/
|
*/
|
||||||
declare module "dns/promises" {
|
declare module 'dns/promises' {
|
||||||
import {
|
import {
|
||||||
|
LookupAddress,
|
||||||
|
LookupOneOptions,
|
||||||
|
LookupAllOptions,
|
||||||
|
LookupOptions,
|
||||||
AnyRecord,
|
AnyRecord,
|
||||||
CaaRecord,
|
CaaRecord,
|
||||||
LookupAddress,
|
|
||||||
LookupAllOptions,
|
|
||||||
LookupOneOptions,
|
|
||||||
LookupOptions,
|
|
||||||
MxRecord,
|
MxRecord,
|
||||||
NaptrRecord,
|
NaptrRecord,
|
||||||
|
SoaRecord,
|
||||||
|
SrvRecord,
|
||||||
|
ResolveWithTtlOptions,
|
||||||
RecordWithTtl,
|
RecordWithTtl,
|
||||||
ResolveOptions,
|
ResolveOptions,
|
||||||
ResolverOptions,
|
ResolverOptions,
|
||||||
ResolveWithTtlOptions,
|
} from 'node:dns';
|
||||||
SoaRecord,
|
|
||||||
SrvRecord,
|
|
||||||
} from "node:dns";
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
|
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
|
||||||
* that are currently configured for DNS resolution. A string will include a port
|
* that are currently configured for DNS resolution. A string will include a port
|
||||||
@@ -52,7 +52,7 @@ declare module "dns/promises" {
|
|||||||
*
|
*
|
||||||
* `dnsPromises.lookup()` does not necessarily have anything to do with the DNS
|
* `dnsPromises.lookup()` does not necessarily have anything to do with the DNS
|
||||||
* protocol. The implementation uses an operating system facility that can
|
* protocol. The implementation uses an operating system facility that can
|
||||||
* associate names with addresses and vice versa. This implementation can have
|
* associate names with addresses, and vice versa. This implementation can have
|
||||||
* subtle but important consequences on the behavior of any Node.js program. Please
|
* subtle but important consequences on the behavior of any Node.js program. Please
|
||||||
* take some time to consult the `Implementation considerations section` before
|
* take some time to consult the `Implementation considerations section` before
|
||||||
* using `dnsPromises.lookup()`.
|
* using `dnsPromises.lookup()`.
|
||||||
@@ -60,7 +60,7 @@ declare module "dns/promises" {
|
|||||||
* Example usage:
|
* Example usage:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dns = require('node:dns');
|
* const dns = require('dns');
|
||||||
* const dnsPromises = dns.promises;
|
* const dnsPromises = dns.promises;
|
||||||
* const options = {
|
* const options = {
|
||||||
* family: 6,
|
* family: 6,
|
||||||
@@ -96,7 +96,7 @@ declare module "dns/promises" {
|
|||||||
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
|
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const dnsPromises = require('node:dns').promises;
|
* const dnsPromises = require('dns').promises;
|
||||||
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
||||||
* console.log(result.hostname, result.service);
|
* console.log(result.hostname, result.service);
|
||||||
* // Prints: localhost ssh
|
* // Prints: localhost ssh
|
||||||
@@ -106,7 +106,7 @@ declare module "dns/promises" {
|
|||||||
*/
|
*/
|
||||||
function lookupService(
|
function lookupService(
|
||||||
address: string,
|
address: string,
|
||||||
port: number,
|
port: number
|
||||||
): Promise<{
|
): Promise<{
|
||||||
hostname: string;
|
hostname: string;
|
||||||
service: string;
|
service: string;
|
||||||
@@ -125,22 +125,19 @@ declare module "dns/promises" {
|
|||||||
* @param [rrtype='A'] Resource record type.
|
* @param [rrtype='A'] Resource record type.
|
||||||
*/
|
*/
|
||||||
function resolve(hostname: string): Promise<string[]>;
|
function resolve(hostname: string): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'A'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'AAAA'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
function resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
function resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'CNAME'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
function resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'NS'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
function resolve(hostname: string, rrtype: 'PTR'): Promise<string[]>;
|
||||||
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
function resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
|
||||||
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
||||||
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
||||||
function resolve(
|
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||||
hostname: string,
|
|
||||||
rrtype: string,
|
|
||||||
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4
|
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4
|
||||||
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
||||||
@@ -192,7 +189,7 @@ declare module "dns/promises" {
|
|||||||
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
|
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
|
||||||
* the `Promise` is resolved with an array of objects containing available
|
* the `Promise` is resolved with an array of objects containing available
|
||||||
* certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
|
* certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
|
||||||
* @since v15.0.0, v14.17.0
|
* @since v15.0.0
|
||||||
*/
|
*/
|
||||||
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
||||||
/**
|
/**
|
||||||
@@ -209,7 +206,7 @@ declare module "dns/promises" {
|
|||||||
*/
|
*/
|
||||||
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
||||||
/**
|
/**
|
||||||
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array
|
* Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array
|
||||||
* of objects with the following properties:
|
* of objects with the following properties:
|
||||||
*
|
*
|
||||||
* * `flags`
|
* * `flags`
|
||||||
@@ -335,61 +332,16 @@ declare module "dns/promises" {
|
|||||||
*/
|
*/
|
||||||
function setServers(servers: ReadonlyArray<string>): void;
|
function setServers(servers: ReadonlyArray<string>): void;
|
||||||
/**
|
/**
|
||||||
* Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
|
* Set the default value of `verbatim` in {@link lookup}. The value could be:
|
||||||
|
* - `ipv4first`: sets default `verbatim` `false`.
|
||||||
|
* - `verbatim`: sets default `verbatim` `true`.
|
||||||
*
|
*
|
||||||
* * `ipv4first`: sets default `verbatim` `false`.
|
* The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
|
||||||
* * `verbatim`: sets default `verbatim` `true`.
|
* When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
|
||||||
*
|
* @since v14.18.0
|
||||||
* The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have
|
* @param order must be 'ipv4first' or 'verbatim'.
|
||||||
* higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the
|
|
||||||
* default dns orders in workers.
|
|
||||||
* @since v16.4.0, v14.18.0
|
|
||||||
* @param order must be `'ipv4first'` or `'verbatim'`.
|
|
||||||
*/
|
|
||||||
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
|
|
||||||
/**
|
|
||||||
* An independent resolver for DNS requests.
|
|
||||||
*
|
|
||||||
* Creating a new resolver uses the default server settings. Setting
|
|
||||||
* the servers used for a resolver using `resolver.setServers()` does not affect
|
|
||||||
* other resolvers:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* const { Resolver } = require('node:dns').promises;
|
|
||||||
* const resolver = new Resolver();
|
|
||||||
* resolver.setServers(['4.4.4.4']);
|
|
||||||
*
|
|
||||||
* // This request will use the server at 4.4.4.4, independent of global settings.
|
|
||||||
* resolver.resolve4('example.org').then((addresses) => {
|
|
||||||
* // ...
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* // Alternatively, the same code can be written using async-await style.
|
|
||||||
* (async function() {
|
|
||||||
* const addresses = await resolver.resolve4('example.org');
|
|
||||||
* })();
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* The following methods from the `dnsPromises` API are available:
|
|
||||||
*
|
|
||||||
* * `resolver.getServers()`
|
|
||||||
* * `resolver.resolve()`
|
|
||||||
* * `resolver.resolve4()`
|
|
||||||
* * `resolver.resolve6()`
|
|
||||||
* * `resolver.resolveAny()`
|
|
||||||
* * `resolver.resolveCaa()`
|
|
||||||
* * `resolver.resolveCname()`
|
|
||||||
* * `resolver.resolveMx()`
|
|
||||||
* * `resolver.resolveNaptr()`
|
|
||||||
* * `resolver.resolveNs()`
|
|
||||||
* * `resolver.resolvePtr()`
|
|
||||||
* * `resolver.resolveSoa()`
|
|
||||||
* * `resolver.resolveSrv()`
|
|
||||||
* * `resolver.resolveTxt()`
|
|
||||||
* * `resolver.reverse()`
|
|
||||||
* * `resolver.setServers()`
|
|
||||||
* @since v10.6.0
|
|
||||||
*/
|
*/
|
||||||
|
function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
|
||||||
class Resolver {
|
class Resolver {
|
||||||
constructor(options?: ResolverOptions);
|
constructor(options?: ResolverOptions);
|
||||||
cancel(): void;
|
cancel(): void;
|
||||||
@@ -398,7 +350,6 @@ declare module "dns/promises" {
|
|||||||
resolve4: typeof resolve4;
|
resolve4: typeof resolve4;
|
||||||
resolve6: typeof resolve6;
|
resolve6: typeof resolve6;
|
||||||
resolveAny: typeof resolveAny;
|
resolveAny: typeof resolveAny;
|
||||||
resolveCaa: typeof resolveCaa;
|
|
||||||
resolveCname: typeof resolveCname;
|
resolveCname: typeof resolveCname;
|
||||||
resolveMx: typeof resolveMx;
|
resolveMx: typeof resolveMx;
|
||||||
resolveNaptr: typeof resolveNaptr;
|
resolveNaptr: typeof resolveNaptr;
|
||||||
@@ -412,6 +363,6 @@ declare module "dns/promises" {
|
|||||||
setServers: typeof setServers;
|
setServers: typeof setServers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module "node:dns/promises" {
|
declare module 'node:dns/promises' {
|
||||||
export * from "dns/promises";
|
export * from 'dns/promises';
|
||||||
}
|
}
|
||||||
|
|||||||
122
node_modules/@types/node/dom-events.d.ts
generated
vendored
122
node_modules/@types/node/dom-events.d.ts
generated
vendored
@@ -1,122 +0,0 @@
|
|||||||
export {}; // Don't export anything!
|
|
||||||
|
|
||||||
//// DOM-like Events
|
|
||||||
// NB: The Event / EventTarget / EventListener implementations below were copied
|
|
||||||
// from lib.dom.d.ts, then edited to reflect Node's documentation at
|
|
||||||
// https://nodejs.org/api/events.html#class-eventtarget.
|
|
||||||
// Please read that link to understand important implementation differences.
|
|
||||||
|
|
||||||
// This conditional type will be the existing global Event in a browser, or
|
|
||||||
// the copy below in a Node environment.
|
|
||||||
type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {}
|
|
||||||
: {
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
readonly bubbles: boolean;
|
|
||||||
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
cancelBubble: () => void;
|
|
||||||
/** True if the event was created with the cancelable option */
|
|
||||||
readonly cancelable: boolean;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
readonly composed: boolean;
|
|
||||||
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
composedPath(): [EventTarget?];
|
|
||||||
/** Alias for event.target. */
|
|
||||||
readonly currentTarget: EventTarget | null;
|
|
||||||
/** Is true if cancelable is true and event.preventDefault() has been called. */
|
|
||||||
readonly defaultPrevented: boolean;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
readonly eventPhase: 0 | 2;
|
|
||||||
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
|
|
||||||
readonly isTrusted: boolean;
|
|
||||||
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
|
|
||||||
preventDefault(): void;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
returnValue: boolean;
|
|
||||||
/** Alias for event.target. */
|
|
||||||
readonly srcElement: EventTarget | null;
|
|
||||||
/** Stops the invocation of event listeners after the current one completes. */
|
|
||||||
stopImmediatePropagation(): void;
|
|
||||||
/** This is not used in Node.js and is provided purely for completeness. */
|
|
||||||
stopPropagation(): void;
|
|
||||||
/** The `EventTarget` dispatching the event */
|
|
||||||
readonly target: EventTarget | null;
|
|
||||||
/** The millisecond timestamp when the Event object was created. */
|
|
||||||
readonly timeStamp: number;
|
|
||||||
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
|
|
||||||
readonly type: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
// See comment above explaining conditional type
|
|
||||||
type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {}
|
|
||||||
: {
|
|
||||||
/**
|
|
||||||
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
|
|
||||||
*
|
|
||||||
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
|
|
||||||
*
|
|
||||||
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
|
|
||||||
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
|
|
||||||
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
|
|
||||||
*/
|
|
||||||
addEventListener(
|
|
||||||
type: string,
|
|
||||||
listener: EventListener | EventListenerObject,
|
|
||||||
options?: AddEventListenerOptions | boolean,
|
|
||||||
): void;
|
|
||||||
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
|
|
||||||
dispatchEvent(event: Event): boolean;
|
|
||||||
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
|
|
||||||
removeEventListener(
|
|
||||||
type: string,
|
|
||||||
listener: EventListener | EventListenerObject,
|
|
||||||
options?: EventListenerOptions | boolean,
|
|
||||||
): void;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface EventInit {
|
|
||||||
bubbles?: boolean;
|
|
||||||
cancelable?: boolean;
|
|
||||||
composed?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EventListenerOptions {
|
|
||||||
/** Not directly used by Node.js. Added for API completeness. Default: `false`. */
|
|
||||||
capture?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AddEventListenerOptions extends EventListenerOptions {
|
|
||||||
/** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */
|
|
||||||
once?: boolean;
|
|
||||||
/** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */
|
|
||||||
passive?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EventListener {
|
|
||||||
(evt: Event): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EventListenerObject {
|
|
||||||
handleEvent(object: Event): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
import {} from "events"; // Make this an ambient declaration
|
|
||||||
declare global {
|
|
||||||
/** An event which takes place in the DOM. */
|
|
||||||
interface Event extends __Event {}
|
|
||||||
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
|
|
||||||
: {
|
|
||||||
prototype: __Event;
|
|
||||||
new(type: string, eventInitDict?: EventInit): __Event;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EventTarget is a DOM interface implemented by objects that can
|
|
||||||
* receive events and may have listeners for them.
|
|
||||||
*/
|
|
||||||
interface EventTarget extends __EventTarget {}
|
|
||||||
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
|
|
||||||
: {
|
|
||||||
prototype: __EventTarget;
|
|
||||||
new(): __EventTarget;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
19
node_modules/@types/node/domain.d.ts
generated
vendored
Normal file → Executable file
19
node_modules/@types/node/domain.d.ts
generated
vendored
Normal file → Executable file
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* **This module is pending deprecation.** Once a replacement API has been
|
* **This module is pending deprecation.** Once a replacement API has been
|
||||||
* finalized, this module will be fully deprecated. Most developers should
|
* finalized, this module will be fully deprecated. Most developers should**not** have cause to use this module. Users who absolutely must have
|
||||||
* **not** have cause to use this module. Users who absolutely must have
|
|
||||||
* the functionality that domains provide may rely on it for the time being
|
* the functionality that domains provide may rely on it for the time being
|
||||||
* but should expect to have to migrate to a different solution
|
* but should expect to have to migrate to a different solution
|
||||||
* in the future.
|
* in the future.
|
||||||
@@ -12,10 +11,10 @@
|
|||||||
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
||||||
* exit immediately with an error code.
|
* exit immediately with an error code.
|
||||||
* @deprecated Since v1.4.2 - Deprecated
|
* @deprecated Since v1.4.2 - Deprecated
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/domain.js)
|
||||||
*/
|
*/
|
||||||
declare module "domain" {
|
declare module 'domain' {
|
||||||
import EventEmitter = require("node:events");
|
import EventEmitter = require('node:events');
|
||||||
/**
|
/**
|
||||||
* The `Domain` class encapsulates the functionality of routing errors and
|
* The `Domain` class encapsulates the functionality of routing errors and
|
||||||
* uncaught exceptions to the active `Domain` object.
|
* uncaught exceptions to the active `Domain` object.
|
||||||
@@ -56,15 +55,15 @@ declare module "domain" {
|
|||||||
exit(): void;
|
exit(): void;
|
||||||
/**
|
/**
|
||||||
* Run the supplied function in the context of the domain, implicitly
|
* Run the supplied function in the context of the domain, implicitly
|
||||||
* binding all event emitters, timers, and low-level requests that are
|
* binding all event emitters, timers, and lowlevel requests that are
|
||||||
* created in that context. Optionally, arguments can be passed to
|
* created in that context. Optionally, arguments can be passed to
|
||||||
* the function.
|
* the function.
|
||||||
*
|
*
|
||||||
* This is the most basic way to use a domain.
|
* This is the most basic way to use a domain.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const domain = require('node:domain');
|
* const domain = require('domain');
|
||||||
* const fs = require('node:fs');
|
* const fs = require('fs');
|
||||||
* const d = domain.create();
|
* const d = domain.create();
|
||||||
* d.on('error', (er) => {
|
* d.on('error', (er) => {
|
||||||
* console.error('Caught error!', er);
|
* console.error('Caught error!', er);
|
||||||
@@ -165,6 +164,6 @@ declare module "domain" {
|
|||||||
}
|
}
|
||||||
function create(): Domain;
|
function create(): Domain;
|
||||||
}
|
}
|
||||||
declare module "node:domain" {
|
declare module 'node:domain' {
|
||||||
export * from "domain";
|
export * from 'domain';
|
||||||
}
|
}
|
||||||
|
|||||||
367
node_modules/@types/node/events.d.ts
generated
vendored
Normal file → Executable file
367
node_modules/@types/node/events.d.ts
generated
vendored
Normal file → Executable file
@@ -22,7 +22,7 @@
|
|||||||
* the `eventEmitter.emit()` method is used to trigger the event.
|
* the `eventEmitter.emit()` method is used to trigger the event.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
*
|
*
|
||||||
* class MyEmitter extends EventEmitter {}
|
* class MyEmitter extends EventEmitter {}
|
||||||
*
|
*
|
||||||
@@ -32,61 +32,25 @@
|
|||||||
* });
|
* });
|
||||||
* myEmitter.emit('event');
|
* myEmitter.emit('event');
|
||||||
* ```
|
* ```
|
||||||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js)
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/events.js)
|
||||||
*/
|
*/
|
||||||
declare module "events" {
|
declare module 'events' {
|
||||||
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
|
||||||
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
|
||||||
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
|
||||||
// actually starts exporting the class, uncomment below.
|
|
||||||
// import { EventListener, EventListenerObject } from '__dom-events';
|
|
||||||
// /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */
|
|
||||||
// interface NodeEventTarget extends EventTarget {
|
|
||||||
// /**
|
|
||||||
// * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API.
|
|
||||||
// * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget.
|
|
||||||
// */
|
|
||||||
// addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
|
||||||
// /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */
|
|
||||||
// eventNames(): string[];
|
|
||||||
// /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */
|
|
||||||
// listenerCount(type: string): number;
|
|
||||||
// /** Node.js-specific alias for `eventTarget.removeListener()`. */
|
|
||||||
// off(type: string, listener: EventListener | EventListenerObject): this;
|
|
||||||
// /** Node.js-specific alias for `eventTarget.addListener()`. */
|
|
||||||
// on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
|
||||||
// /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */
|
|
||||||
// once(type: string, listener: EventListener | EventListenerObject): this;
|
|
||||||
// /**
|
|
||||||
// * Node.js-specific extension to the `EventTarget` class.
|
|
||||||
// * If `type` is specified, removes all registered listeners for `type`,
|
|
||||||
// * otherwise removes all registered listeners.
|
|
||||||
// */
|
|
||||||
// removeAllListeners(type: string): this;
|
|
||||||
// /**
|
|
||||||
// * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`.
|
|
||||||
// * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`.
|
|
||||||
// */
|
|
||||||
// removeListener(type: string, listener: EventListener | EventListenerObject): this;
|
|
||||||
// }
|
|
||||||
interface EventEmitterOptions {
|
interface EventEmitterOptions {
|
||||||
/**
|
/**
|
||||||
* Enables automatic capturing of promise rejection.
|
* Enables automatic capturing of promise rejection.
|
||||||
*/
|
*/
|
||||||
captureRejections?: boolean | undefined;
|
captureRejections?: boolean | undefined;
|
||||||
}
|
}
|
||||||
// Any EventTarget with a Node-style `once` function
|
interface NodeEventTarget {
|
||||||
interface _NodeEventTarget {
|
|
||||||
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||||
}
|
}
|
||||||
// Any EventTarget with a DOM-style `addEventListener`
|
interface DOMEventTarget {
|
||||||
interface _DOMEventTarget {
|
|
||||||
addEventListener(
|
addEventListener(
|
||||||
eventName: string,
|
eventName: string,
|
||||||
listener: (...args: any[]) => void,
|
listener: (...args: any[]) => void,
|
||||||
opts?: {
|
opts?: {
|
||||||
once: boolean;
|
once: boolean;
|
||||||
},
|
}
|
||||||
): any;
|
): any;
|
||||||
}
|
}
|
||||||
interface StaticEventEmitterOptions {
|
interface StaticEventEmitterOptions {
|
||||||
@@ -94,10 +58,10 @@ declare module "events" {
|
|||||||
}
|
}
|
||||||
interface EventEmitter extends NodeJS.EventEmitter {}
|
interface EventEmitter extends NodeJS.EventEmitter {}
|
||||||
/**
|
/**
|
||||||
* The `EventEmitter` class is defined and exposed by the `node:events` module:
|
* The `EventEmitter` class is defined and exposed by the `events` module:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* All `EventEmitter`s emit the event `'newListener'` when new listeners are
|
* All `EventEmitter`s emit the event `'newListener'` when new listeners are
|
||||||
@@ -108,9 +72,6 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
class EventEmitter {
|
class EventEmitter {
|
||||||
constructor(options?: EventEmitterOptions);
|
constructor(options?: EventEmitterOptions);
|
||||||
|
|
||||||
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
||||||
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
||||||
@@ -121,28 +82,31 @@ declare module "events" {
|
|||||||
* semantics and does not listen to the `'error'` event.
|
* semantics and does not listen to the `'error'` event.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { once, EventEmitter } from 'node:events';
|
* const { once, EventEmitter } = require('events');
|
||||||
* import process from 'node:process';
|
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* async function run() {
|
||||||
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* process.nextTick(() => {
|
* process.nextTick(() => {
|
||||||
* ee.emit('myevent', 42);
|
* ee.emit('myevent', 42);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* const [value] = await once(ee, 'myevent');
|
* const [value] = await once(ee, 'myevent');
|
||||||
* console.log(value);
|
* console.log(value);
|
||||||
*
|
*
|
||||||
* const err = new Error('kaboom');
|
* const err = new Error('kaboom');
|
||||||
* process.nextTick(() => {
|
* process.nextTick(() => {
|
||||||
* ee.emit('error', err);
|
* ee.emit('error', err);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await once(ee, 'myevent');
|
* await once(ee, 'myevent');
|
||||||
* } catch (err) {
|
* } catch (err) {
|
||||||
* console.error('error happened', err);
|
* console.log('error happened', err);
|
||||||
|
* }
|
||||||
* }
|
* }
|
||||||
|
*
|
||||||
|
* run();
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
|
* The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
|
||||||
@@ -150,13 +114,13 @@ declare module "events" {
|
|||||||
* special handling:
|
* special handling:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter, once } from 'node:events';
|
* const { EventEmitter, once } = require('events');
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* once(ee, 'error')
|
* once(ee, 'error')
|
||||||
* .then(([err]) => console.log('ok', err.message))
|
* .then(([err]) => console.log('ok', err.message))
|
||||||
* .catch((err) => console.error('error', err.message));
|
* .catch((err) => console.log('error', err.message));
|
||||||
*
|
*
|
||||||
* ee.emit('error', new Error('boom'));
|
* ee.emit('error', new Error('boom'));
|
||||||
*
|
*
|
||||||
@@ -166,7 +130,7 @@ declare module "events" {
|
|||||||
* An `AbortSignal` can be used to cancel waiting for the event:
|
* An `AbortSignal` can be used to cancel waiting for the event:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter, once } from 'node:events';
|
* const { EventEmitter, once } = require('events');
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
* const ac = new AbortController();
|
* const ac = new AbortController();
|
||||||
@@ -190,32 +154,29 @@ declare module "events" {
|
|||||||
* ```
|
* ```
|
||||||
* @since v11.13.0, v10.16.0
|
* @since v11.13.0, v10.16.0
|
||||||
*/
|
*/
|
||||||
static once(
|
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||||
emitter: _NodeEventTarget,
|
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||||
eventName: string | symbol,
|
|
||||||
options?: StaticEventEmitterOptions,
|
|
||||||
): Promise<any[]>;
|
|
||||||
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
||||||
/**
|
/**
|
||||||
* ```js
|
* ```js
|
||||||
* import { on, EventEmitter } from 'node:events';
|
* const { on, EventEmitter } = require('events');
|
||||||
* import process from 'node:process';
|
|
||||||
*
|
*
|
||||||
* const ee = new EventEmitter();
|
* (async () => {
|
||||||
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* // Emit later on
|
* // Emit later on
|
||||||
* process.nextTick(() => {
|
* process.nextTick(() => {
|
||||||
* ee.emit('foo', 'bar');
|
* ee.emit('foo', 'bar');
|
||||||
* ee.emit('foo', 42);
|
* ee.emit('foo', 42);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* for await (const event of on(ee, 'foo')) {
|
* for await (const event of on(ee, 'foo')) {
|
||||||
* // The execution of this inner block is synchronous and it
|
* // The execution of this inner block is synchronous and it
|
||||||
* // processes one event at a time (even with await). Do not use
|
* // processes one event at a time (even with await). Do not use
|
||||||
* // if concurrent execution is required.
|
* // if concurrent execution is required.
|
||||||
* console.log(event); // prints ['bar'] [42]
|
* console.log(event); // prints ['bar'] [42]
|
||||||
* }
|
* }
|
||||||
* // Unreachable here
|
* // Unreachable here
|
||||||
|
* })();
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Returns an `AsyncIterator` that iterates `eventName` events. It will throw
|
* Returns an `AsyncIterator` that iterates `eventName` events. It will throw
|
||||||
@@ -226,9 +187,7 @@ declare module "events" {
|
|||||||
* An `AbortSignal` can be used to cancel waiting on events:
|
* An `AbortSignal` can be used to cancel waiting on events:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { on, EventEmitter } from 'node:events';
|
* const { on, EventEmitter } = require('events');
|
||||||
* import process from 'node:process';
|
|
||||||
*
|
|
||||||
* const ac = new AbortController();
|
* const ac = new AbortController();
|
||||||
*
|
*
|
||||||
* (async () => {
|
* (async () => {
|
||||||
@@ -255,17 +214,12 @@ declare module "events" {
|
|||||||
* @param eventName The name of the event being listened for
|
* @param eventName The name of the event being listened for
|
||||||
* @return that iterates `eventName` events emitted by the `emitter`
|
* @return that iterates `eventName` events emitted by the `emitter`
|
||||||
*/
|
*/
|
||||||
static on(
|
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
|
||||||
emitter: NodeJS.EventEmitter,
|
|
||||||
eventName: string,
|
|
||||||
options?: StaticEventEmitterOptions,
|
|
||||||
): AsyncIterableIterator<any>;
|
|
||||||
/**
|
/**
|
||||||
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter, listenerCount } from 'node:events';
|
* const { EventEmitter, listenerCount } = require('events');
|
||||||
*
|
|
||||||
* const myEmitter = new EventEmitter();
|
* const myEmitter = new EventEmitter();
|
||||||
* myEmitter.on('event', () => {});
|
* myEmitter.on('event', () => {});
|
||||||
* myEmitter.on('event', () => {});
|
* myEmitter.on('event', () => {});
|
||||||
@@ -288,164 +242,43 @@ declare module "events" {
|
|||||||
* event target. This is useful for debugging and diagnostic purposes.
|
* event target. This is useful for debugging and diagnostic purposes.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { getEventListeners, EventEmitter } from 'node:events';
|
* const { getEventListeners, EventEmitter } = require('events');
|
||||||
*
|
*
|
||||||
* {
|
* {
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
* const listener = () => console.log('Events are fun');
|
* const listener = () => console.log('Events are fun');
|
||||||
* ee.on('foo', listener);
|
* ee.on('foo', listener);
|
||||||
* console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
|
* getEventListeners(ee, 'foo'); // [listener]
|
||||||
* }
|
* }
|
||||||
* {
|
* {
|
||||||
* const et = new EventTarget();
|
* const et = new EventTarget();
|
||||||
* const listener = () => console.log('Events are fun');
|
* const listener = () => console.log('Events are fun');
|
||||||
* et.addEventListener('foo', listener);
|
* et.addEventListener('foo', listener);
|
||||||
* console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
|
* getEventListeners(et, 'foo'); // [listener]
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @since v15.2.0, v14.17.0
|
* @since v15.2.0
|
||||||
*/
|
*/
|
||||||
static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
||||||
/**
|
/**
|
||||||
* Returns the currently set max amount of listeners.
|
* This symbol shall be used to install a listener for only monitoring `'error'`
|
||||||
|
* events. Listeners installed using this symbol are called before the regular
|
||||||
|
* `'error'` listeners are called.
|
||||||
*
|
*
|
||||||
* For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
|
* Installing a listener using this symbol does not change the behavior once an
|
||||||
* the emitter.
|
* `'error'` event is emitted, therefore the process will still crash if no
|
||||||
*
|
|
||||||
* For `EventTarget`s this is the only way to get the max event listeners for the
|
|
||||||
* event target. If the number of event handlers on a single EventTarget exceeds
|
|
||||||
* the max set, the EventTarget will print a warning.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';
|
|
||||||
*
|
|
||||||
* {
|
|
||||||
* const ee = new EventEmitter();
|
|
||||||
* console.log(getMaxListeners(ee)); // 10
|
|
||||||
* setMaxListeners(11, ee);
|
|
||||||
* console.log(getMaxListeners(ee)); // 11
|
|
||||||
* }
|
|
||||||
* {
|
|
||||||
* const et = new EventTarget();
|
|
||||||
* console.log(getMaxListeners(et)); // 10
|
|
||||||
* setMaxListeners(11, et);
|
|
||||||
* console.log(getMaxListeners(et)); // 11
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
* @since v19.9.0
|
|
||||||
*/
|
|
||||||
static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number;
|
|
||||||
/**
|
|
||||||
* ```js
|
|
||||||
* import { setMaxListeners, EventEmitter } from 'node:events';
|
|
||||||
*
|
|
||||||
* const target = new EventTarget();
|
|
||||||
* const emitter = new EventEmitter();
|
|
||||||
*
|
|
||||||
* setMaxListeners(5, target, emitter);
|
|
||||||
* ```
|
|
||||||
* @since v15.4.0
|
|
||||||
* @param n A non-negative number. The maximum number of listeners per `EventTarget` event.
|
|
||||||
* @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
|
|
||||||
* objects.
|
|
||||||
*/
|
|
||||||
static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void;
|
|
||||||
/**
|
|
||||||
* Listens once to the `abort` event on the provided `signal`.
|
|
||||||
*
|
|
||||||
* Listening to the `abort` event on abort signals is unsafe and may
|
|
||||||
* lead to resource leaks since another third party with the signal can
|
|
||||||
* call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change
|
|
||||||
* this since it would violate the web standard. Additionally, the original
|
|
||||||
* API makes it easy to forget to remove listeners.
|
|
||||||
*
|
|
||||||
* This API allows safely using `AbortSignal`s in Node.js APIs by solving these
|
|
||||||
* two issues by listening to the event such that `stopImmediatePropagation` does
|
|
||||||
* not prevent the listener from running.
|
|
||||||
*
|
|
||||||
* Returns a disposable so that it may be unsubscribed from more easily.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import { addAbortListener } from 'node:events';
|
|
||||||
*
|
|
||||||
* function example(signal) {
|
|
||||||
* let disposable;
|
|
||||||
* try {
|
|
||||||
* signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
|
|
||||||
* disposable = addAbortListener(signal, (e) => {
|
|
||||||
* // Do something when signal is aborted.
|
|
||||||
* });
|
|
||||||
* } finally {
|
|
||||||
* disposable?.[Symbol.dispose]();
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
* @since v20.5.0
|
|
||||||
* @experimental
|
|
||||||
* @return Disposable that removes the `abort` listener.
|
|
||||||
*/
|
|
||||||
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
|
||||||
/**
|
|
||||||
* This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called.
|
|
||||||
*
|
|
||||||
* Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no
|
|
||||||
* regular `'error'` listener is installed.
|
* regular `'error'` listener is installed.
|
||||||
* @since v13.6.0, v12.17.0
|
|
||||||
*/
|
*/
|
||||||
static readonly errorMonitor: unique symbol;
|
static readonly errorMonitor: unique symbol;
|
||||||
/**
|
|
||||||
* Value: `Symbol.for('nodejs.rejection')`
|
|
||||||
*
|
|
||||||
* See how to write a custom `rejection handler`.
|
|
||||||
* @since v13.4.0, v12.16.0
|
|
||||||
*/
|
|
||||||
static readonly captureRejectionSymbol: unique symbol;
|
static readonly captureRejectionSymbol: unique symbol;
|
||||||
/**
|
/**
|
||||||
* Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
|
* Sets or gets the default captureRejection value for all emitters.
|
||||||
*
|
|
||||||
* Change the default `captureRejections` option on all new `EventEmitter` objects.
|
|
||||||
* @since v13.4.0, v12.16.0
|
|
||||||
*/
|
*/
|
||||||
|
// TODO: These should be described using static getter/setter pairs:
|
||||||
static captureRejections: boolean;
|
static captureRejections: boolean;
|
||||||
/**
|
|
||||||
* By default, a maximum of `10` listeners can be registered for any single
|
|
||||||
* event. This limit can be changed for individual `EventEmitter` instances
|
|
||||||
* using the `emitter.setMaxListeners(n)` method. To change the default
|
|
||||||
* for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown.
|
|
||||||
*
|
|
||||||
* Take caution when setting the `events.defaultMaxListeners` because the
|
|
||||||
* change affects _all_`EventEmitter` instances, including those created before
|
|
||||||
* the change is made. However, calling `emitter.setMaxListeners(n)` still has
|
|
||||||
* precedence over `events.defaultMaxListeners`.
|
|
||||||
*
|
|
||||||
* This is not a hard limit. The `EventEmitter` instance will allow
|
|
||||||
* more listeners to be added but will output a trace warning to stderr indicating
|
|
||||||
* that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to
|
|
||||||
* temporarily avoid this warning:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const emitter = new EventEmitter();
|
|
||||||
* emitter.setMaxListeners(emitter.getMaxListeners() + 1);
|
|
||||||
* emitter.once('event', () => {
|
|
||||||
* // do stuff
|
|
||||||
* emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
|
|
||||||
* });
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* The `--trace-warnings` command-line flag can be used to display the
|
|
||||||
* stack trace for such warnings.
|
|
||||||
*
|
|
||||||
* The emitted warning can be inspected with `process.on('warning')` and will
|
|
||||||
* have the additional `emitter`, `type`, and `count` properties, referring to
|
|
||||||
* the event emitter instance, the event's name and the number of attached
|
|
||||||
* listeners, respectively.
|
|
||||||
* Its `name` property is set to `'MaxListenersExceededWarning'`.
|
|
||||||
* @since v0.11.2
|
|
||||||
*/
|
|
||||||
static defaultMaxListeners: number;
|
static defaultMaxListeners: number;
|
||||||
}
|
}
|
||||||
import internal = require("node:events");
|
import internal = require('node:events');
|
||||||
namespace EventEmitter {
|
namespace EventEmitter {
|
||||||
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
||||||
export { internal as EventEmitter };
|
export { internal as EventEmitter };
|
||||||
@@ -455,54 +288,10 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
signal?: AbortSignal | undefined;
|
signal?: AbortSignal | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventEmitterReferencingAsyncResource extends AsyncResource {
|
|
||||||
readonly eventEmitter: EventEmitterAsyncResource;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
|
|
||||||
/**
|
|
||||||
* The type of async event, this is required when instantiating `EventEmitterAsyncResource`
|
|
||||||
* directly rather than as a child class.
|
|
||||||
* @default new.target.name if instantiated as a child class.
|
|
||||||
*/
|
|
||||||
name?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that require
|
|
||||||
* manual async tracking. Specifically, all events emitted by instances of
|
|
||||||
* `EventEmitterAsyncResource` will run within its async context.
|
|
||||||
*
|
|
||||||
* The EventEmitterAsyncResource class has the same methods and takes the
|
|
||||||
* same options as EventEmitter and AsyncResource themselves.
|
|
||||||
* @throws if `options.name` is not provided when instantiated directly.
|
|
||||||
* @since v17.4.0, v16.14.0
|
|
||||||
*/
|
|
||||||
export class EventEmitterAsyncResource extends EventEmitter {
|
|
||||||
/**
|
|
||||||
* @param options Only optional in child class.
|
|
||||||
*/
|
|
||||||
constructor(options?: EventEmitterAsyncResourceOptions);
|
|
||||||
/**
|
|
||||||
* Call all destroy hooks. This should only ever be called once. An
|
|
||||||
* error will be thrown if it is called more than once. This must be
|
|
||||||
* manually called. If the resource is left to be collected by the GC then
|
|
||||||
* the destroy hooks will never be called.
|
|
||||||
*/
|
|
||||||
emitDestroy(): void;
|
|
||||||
/** The unique asyncId assigned to the resource. */
|
|
||||||
readonly asyncId: number;
|
|
||||||
/** The same triggerAsyncId that is passed to the AsyncResource constructor. */
|
|
||||||
readonly triggerAsyncId: number;
|
|
||||||
/** The underlying AsyncResource */
|
|
||||||
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
global {
|
global {
|
||||||
namespace NodeJS {
|
namespace NodeJS {
|
||||||
interface EventEmitter {
|
interface EventEmitter {
|
||||||
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
||||||
/**
|
/**
|
||||||
* Alias for `emitter.on(eventName, listener)`.
|
* Alias for `emitter.on(eventName, listener)`.
|
||||||
* @since v0.1.26
|
* @since v0.1.26
|
||||||
@@ -526,7 +315,6 @@ declare module "events" {
|
|||||||
* event listener to the beginning of the listeners array.
|
* event listener to the beginning of the listeners array.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const myEE = new EventEmitter();
|
* const myEE = new EventEmitter();
|
||||||
* myEE.on('foo', () => console.log('a'));
|
* myEE.on('foo', () => console.log('a'));
|
||||||
* myEE.prependListener('foo', () => console.log('b'));
|
* myEE.prependListener('foo', () => console.log('b'));
|
||||||
@@ -556,7 +344,6 @@ declare module "events" {
|
|||||||
* event listener to the beginning of the listeners array.
|
* event listener to the beginning of the listeners array.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const myEE = new EventEmitter();
|
* const myEE = new EventEmitter();
|
||||||
* myEE.once('foo', () => console.log('a'));
|
* myEE.once('foo', () => console.log('a'));
|
||||||
* myEE.prependOnceListener('foo', () => console.log('b'));
|
* myEE.prependOnceListener('foo', () => console.log('b'));
|
||||||
@@ -588,12 +375,10 @@ declare module "events" {
|
|||||||
* called multiple times to remove each instance.
|
* called multiple times to remove each instance.
|
||||||
*
|
*
|
||||||
* Once an event is emitted, all listeners attached to it at the
|
* Once an event is emitted, all listeners attached to it at the
|
||||||
* time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
|
* time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
|
||||||
* will not remove them from`emit()` in progress. Subsequent events behave as expected.
|
* not remove them from`emit()` in progress. Subsequent events behave as expected.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* class MyEmitter extends EventEmitter {}
|
|
||||||
* const myEmitter = new MyEmitter();
|
* const myEmitter = new MyEmitter();
|
||||||
*
|
*
|
||||||
* const callbackA = () => {
|
* const callbackA = () => {
|
||||||
@@ -634,7 +419,6 @@ declare module "events" {
|
|||||||
* recently added instance. In the example the `once('ping')`listener is removed:
|
* recently added instance. In the example the `once('ping')`listener is removed:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const ee = new EventEmitter();
|
* const ee = new EventEmitter();
|
||||||
*
|
*
|
||||||
* function pong() {
|
* function pong() {
|
||||||
@@ -703,7 +487,6 @@ declare module "events" {
|
|||||||
* including any wrappers (such as those created by `.once()`).
|
* including any wrappers (such as those created by `.once()`).
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
|
||||||
* const emitter = new EventEmitter();
|
* const emitter = new EventEmitter();
|
||||||
* emitter.once('log', () => console.log('log once'));
|
* emitter.once('log', () => console.log('log once'));
|
||||||
*
|
*
|
||||||
@@ -736,7 +519,7 @@ declare module "events" {
|
|||||||
* Returns `true` if the event had listeners, `false` otherwise.
|
* Returns `true` if the event had listeners, `false` otherwise.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
* const myEmitter = new EventEmitter();
|
* const myEmitter = new EventEmitter();
|
||||||
*
|
*
|
||||||
* // First listener
|
* // First listener
|
||||||
@@ -771,14 +554,11 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
emit(eventName: string | symbol, ...args: any[]): boolean;
|
emit(eventName: string | symbol, ...args: any[]): boolean;
|
||||||
/**
|
/**
|
||||||
* Returns the number of listeners listening for the event named `eventName`.
|
* Returns the number of listeners listening to the event named `eventName`.
|
||||||
* If `listener` is provided, it will return how many times the listener is found
|
|
||||||
* in the list of the listeners of the event.
|
|
||||||
* @since v3.2.0
|
* @since v3.2.0
|
||||||
* @param eventName The name of the event being listened for
|
* @param eventName The name of the event being listened for
|
||||||
* @param listener The event handler function
|
|
||||||
*/
|
*/
|
||||||
listenerCount(eventName: string | symbol, listener?: Function): number;
|
listenerCount(eventName: string | symbol): number;
|
||||||
/**
|
/**
|
||||||
* Adds the `listener` function to the _beginning_ of the listeners array for the
|
* Adds the `listener` function to the _beginning_ of the listeners array for the
|
||||||
* event named `eventName`. No checks are made to see if the `listener` has
|
* event named `eventName`. No checks are made to see if the `listener` has
|
||||||
@@ -798,7 +578,7 @@ declare module "events" {
|
|||||||
*/
|
*/
|
||||||
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||||
/**
|
/**
|
||||||
* Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this
|
* Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
|
||||||
* listener is removed, and then invoked.
|
* listener is removed, and then invoked.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
@@ -818,8 +598,7 @@ declare module "events" {
|
|||||||
* listeners. The values in the array are strings or `Symbol`s.
|
* listeners. The values in the array are strings or `Symbol`s.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { EventEmitter } from 'node:events';
|
* const EventEmitter = require('events');
|
||||||
*
|
|
||||||
* const myEE = new EventEmitter();
|
* const myEE = new EventEmitter();
|
||||||
* myEE.on('foo', () => {});
|
* myEE.on('foo', () => {});
|
||||||
* myEE.on('bar', () => {});
|
* myEE.on('bar', () => {});
|
||||||
@@ -838,7 +617,7 @@ declare module "events" {
|
|||||||
}
|
}
|
||||||
export = EventEmitter;
|
export = EventEmitter;
|
||||||
}
|
}
|
||||||
declare module "node:events" {
|
declare module 'node:events' {
|
||||||
import events = require("events");
|
import events = require('events');
|
||||||
export = events;
|
export = events;
|
||||||
}
|
}
|
||||||
|
|||||||
1365
node_modules/@types/node/fs.d.ts
generated
vendored
Normal file → Executable file
1365
node_modules/@types/node/fs.d.ts
generated
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
417
node_modules/@types/node/fs/promises.d.ts
generated
vendored
Normal file → Executable file
417
node_modules/@types/node/fs/promises.d.ts
generated
vendored
Normal file → Executable file
@@ -8,52 +8,45 @@
|
|||||||
* concurrent modifications on the same file or data corruption may occur.
|
* concurrent modifications on the same file or data corruption may occur.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
declare module "fs/promises" {
|
declare module 'fs/promises' {
|
||||||
import { Abortable } from "node:events";
|
import { Abortable } from 'node:events';
|
||||||
import { Stream } from "node:stream";
|
import { Stream } from 'node:stream';
|
||||||
import { ReadableStream } from "node:stream/web";
|
|
||||||
import {
|
import {
|
||||||
|
Stats,
|
||||||
BigIntStats,
|
BigIntStats,
|
||||||
BigIntStatsFs,
|
StatOptions,
|
||||||
BufferEncodingOption,
|
WriteVResult,
|
||||||
constants as fsConstants,
|
|
||||||
CopyOptions,
|
|
||||||
Dir,
|
|
||||||
Dirent,
|
|
||||||
MakeDirectoryOptions,
|
|
||||||
Mode,
|
|
||||||
ObjectEncodingOptions,
|
|
||||||
OpenDirOptions,
|
|
||||||
OpenMode,
|
|
||||||
PathLike,
|
|
||||||
ReadStream,
|
|
||||||
ReadVResult,
|
ReadVResult,
|
||||||
|
PathLike,
|
||||||
RmDirOptions,
|
RmDirOptions,
|
||||||
RmOptions,
|
RmOptions,
|
||||||
StatFsOptions,
|
MakeDirectoryOptions,
|
||||||
StatOptions,
|
Dirent,
|
||||||
Stats,
|
OpenDirOptions,
|
||||||
StatsFs,
|
Dir,
|
||||||
TimeLike,
|
ObjectEncodingOptions,
|
||||||
WatchEventType,
|
BufferEncodingOption,
|
||||||
|
OpenMode,
|
||||||
|
Mode,
|
||||||
WatchOptions,
|
WatchOptions,
|
||||||
|
WatchEventType,
|
||||||
|
CopyOptions,
|
||||||
|
ReadStream,
|
||||||
WriteStream,
|
WriteStream,
|
||||||
WriteVResult,
|
} from 'node:fs';
|
||||||
} from "node:fs";
|
|
||||||
import { Interface as ReadlineInterface } from "node:readline";
|
|
||||||
interface FileChangeInfo<T extends string | Buffer> {
|
interface FileChangeInfo<T extends string | Buffer> {
|
||||||
eventType: WatchEventType;
|
eventType: WatchEventType;
|
||||||
filename: T | null;
|
filename: T;
|
||||||
}
|
}
|
||||||
interface FlagAndOpenMode {
|
interface FlagAndOpenMode {
|
||||||
mode?: Mode | undefined;
|
mode?: Mode | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
}
|
}
|
||||||
interface FileReadResult<T extends NodeJS.ArrayBufferView> {
|
interface FileReadResult<T extends ArrayBufferView> {
|
||||||
bytesRead: number;
|
bytesRead: number;
|
||||||
buffer: T;
|
buffer: T;
|
||||||
}
|
}
|
||||||
interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
|
interface FileReadOptions<T extends ArrayBufferView = Buffer> {
|
||||||
/**
|
/**
|
||||||
* @default `Buffer.alloc(0xffff)`
|
* @default `Buffer.alloc(0xffff)`
|
||||||
*/
|
*/
|
||||||
@@ -81,14 +74,6 @@ declare module "fs/promises" {
|
|||||||
autoClose?: boolean | undefined;
|
autoClose?: boolean | undefined;
|
||||||
emitClose?: boolean | undefined;
|
emitClose?: boolean | undefined;
|
||||||
start?: number | undefined;
|
start?: number | undefined;
|
||||||
highWaterMark?: number | undefined;
|
|
||||||
}
|
|
||||||
interface ReadableWebStreamOptions {
|
|
||||||
/**
|
|
||||||
* Whether to open a normal or a `'bytes'` stream.
|
|
||||||
* @since v20.0.0
|
|
||||||
*/
|
|
||||||
type?: "bytes" | undefined;
|
|
||||||
}
|
}
|
||||||
// TODO: Add `EventEmitter` close
|
// TODO: Add `EventEmitter` close
|
||||||
interface FileHandle {
|
interface FileHandle {
|
||||||
@@ -105,10 +90,7 @@ declare module "fs/promises" {
|
|||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
appendFile(
|
appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
||||||
data: string | Uint8Array,
|
|
||||||
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -125,8 +107,8 @@ declare module "fs/promises" {
|
|||||||
*/
|
*/
|
||||||
chmod(mode: Mode): Promise<void>;
|
chmod(mode: Mode): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream
|
* Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
|
||||||
* returned by this method has a default `highWaterMark` of 64 KiB.
|
* returned by this method has a default `highWaterMark` of 64 kb.
|
||||||
*
|
*
|
||||||
* `options` can include `start` and `end` values to read a range of bytes from
|
* `options` can include `start` and `end` values to read a range of bytes from
|
||||||
* the file instead of the entire file. Both `start` and `end` are inclusive and
|
* the file instead of the entire file. Both `start` and `end` are inclusive and
|
||||||
@@ -144,7 +126,7 @@ declare module "fs/promises" {
|
|||||||
* destroyed. Set the `emitClose` option to `false` to change this behavior.
|
* destroyed. Set the `emitClose` option to `false` to change this behavior.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* const fd = await open('/dev/input/event0');
|
* const fd = await open('/dev/input/event0');
|
||||||
* // Create a stream from some character device.
|
* // Create a stream from some character device.
|
||||||
@@ -170,7 +152,7 @@ declare module "fs/promises" {
|
|||||||
* An example to read the last 10 bytes of a file which is 100 bytes long:
|
* An example to read the last 10 bytes of a file which is 100 bytes long:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* const fd = await open('sample.txt');
|
* const fd = await open('sample.txt');
|
||||||
* fd.createReadStream({ start: 90, end: 99 });
|
* fd.createReadStream({ start: 90, end: 99 });
|
||||||
@@ -181,9 +163,9 @@ declare module "fs/promises" {
|
|||||||
/**
|
/**
|
||||||
* `options` may also include a `start` option to allow writing data at some
|
* `options` may also include a `start` option to allow writing data at some
|
||||||
* position past the beginning of the file, allowed values are in the
|
* position past the beginning of the file, allowed values are in the
|
||||||
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than replacing
|
||||||
* replacing it may require the `flags` `open` option to be set to `r+` rather than
|
* it may require the `flags` `open` option to be set to `r+` rather than the
|
||||||
* the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
* default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
||||||
*
|
*
|
||||||
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
||||||
* then the file descriptor won't be closed, even if there's an error.
|
* then the file descriptor won't be closed, even if there's an error.
|
||||||
@@ -209,7 +191,7 @@ declare module "fs/promises" {
|
|||||||
* device. The specific implementation is operating system and device specific.
|
* device. The specific implementation is operating system and device specific.
|
||||||
* Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
|
* Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fufills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
sync(): Promise<void>;
|
sync(): Promise<void>;
|
||||||
/**
|
/**
|
||||||
@@ -225,38 +207,8 @@ declare module "fs/promises" {
|
|||||||
* integer, the current file position will remain unchanged.
|
* integer, the current file position will remain unchanged.
|
||||||
* @return Fulfills upon success with an object with two properties:
|
* @return Fulfills upon success with an object with two properties:
|
||||||
*/
|
*/
|
||||||
read<T extends NodeJS.ArrayBufferView>(
|
read<T extends ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
|
||||||
buffer: T,
|
read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
||||||
offset?: number | null,
|
|
||||||
length?: number | null,
|
|
||||||
position?: number | null,
|
|
||||||
): Promise<FileReadResult<T>>;
|
|
||||||
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
||||||
/**
|
|
||||||
* Returns a `ReadableStream` that may be used to read the files data.
|
|
||||||
*
|
|
||||||
* An error will be thrown if this method is called more than once or is called
|
|
||||||
* after the `FileHandle` is closed or closing.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import {
|
|
||||||
* open,
|
|
||||||
* } from 'node:fs/promises';
|
|
||||||
*
|
|
||||||
* const file = await open('./some/file/to/read');
|
|
||||||
*
|
|
||||||
* for await (const chunk of file.readableWebStream())
|
|
||||||
* console.log(chunk);
|
|
||||||
*
|
|
||||||
* await file.close();
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* While the `ReadableStream` will read the file to completion, it will not
|
|
||||||
* close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
|
|
||||||
* @since v17.0.0
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
*
|
*
|
||||||
@@ -275,7 +227,7 @@ declare module "fs/promises" {
|
|||||||
options?: {
|
options?: {
|
||||||
encoding?: null | undefined;
|
encoding?: null | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} | null,
|
} | null
|
||||||
): Promise<Buffer>;
|
): Promise<Buffer>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||||
@@ -286,10 +238,10 @@ declare module "fs/promises" {
|
|||||||
readFile(
|
readFile(
|
||||||
options:
|
options:
|
||||||
| {
|
| {
|
||||||
encoding: BufferEncoding;
|
encoding: BufferEncoding;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
}
|
}
|
||||||
| BufferEncoding,
|
| BufferEncoding
|
||||||
): Promise<string>;
|
): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||||
@@ -300,27 +252,11 @@ declare module "fs/promises" {
|
|||||||
readFile(
|
readFile(
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
})
|
})
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string | Buffer>;
|
): Promise<string | Buffer>;
|
||||||
/**
|
|
||||||
* Convenience method to create a `readline` interface and stream over the file.
|
|
||||||
* See `filehandle.createReadStream()` for the options.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import { open } from 'node:fs/promises';
|
|
||||||
*
|
|
||||||
* const file = await open('./some/file/to/read');
|
|
||||||
*
|
|
||||||
* for await (const line of file.readLines()) {
|
|
||||||
* console.log(line);
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
* @since v18.11.0
|
|
||||||
*/
|
|
||||||
readLines(options?: CreateReadStreamOptions): ReadlineInterface;
|
|
||||||
/**
|
/**
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with an {fs.Stats} for the file.
|
* @return Fulfills with an {fs.Stats} for the file.
|
||||||
@@ -328,12 +264,12 @@ declare module "fs/promises" {
|
|||||||
stat(
|
stat(
|
||||||
opts?: StatOptions & {
|
opts?: StatOptions & {
|
||||||
bigint?: false | undefined;
|
bigint?: false | undefined;
|
||||||
},
|
}
|
||||||
): Promise<Stats>;
|
): Promise<Stats>;
|
||||||
stat(
|
stat(
|
||||||
opts: StatOptions & {
|
opts: StatOptions & {
|
||||||
bigint: true;
|
bigint: true;
|
||||||
},
|
}
|
||||||
): Promise<BigIntStats>;
|
): Promise<BigIntStats>;
|
||||||
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||||
/**
|
/**
|
||||||
@@ -345,7 +281,7 @@ declare module "fs/promises" {
|
|||||||
* The following example retains only the first four bytes of the file:
|
* The following example retains only the first four bytes of the file:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* let filehandle = null;
|
* let filehandle = null;
|
||||||
* try {
|
* try {
|
||||||
@@ -369,12 +305,13 @@ declare module "fs/promises" {
|
|||||||
* Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
|
* Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
|
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
||||||
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
||||||
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
|
||||||
* The promise is resolved with no arguments upon success.
|
* object with an own `toString` function
|
||||||
|
* property. The promise is resolved with no arguments upon success.
|
||||||
*
|
*
|
||||||
* If `options` is a string, then it specifies the `encoding`.
|
* If `options` is a string, then it specifies the `encoding`.
|
||||||
*
|
*
|
||||||
@@ -388,33 +325,32 @@ declare module "fs/promises" {
|
|||||||
* beginning of the file.
|
* beginning of the file.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
*/
|
*/
|
||||||
writeFile(
|
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
|
||||||
data: string | Uint8Array,
|
|
||||||
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Write `buffer` to the file.
|
* Write `buffer` to the file.
|
||||||
*
|
*
|
||||||
|
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
||||||
|
*
|
||||||
* The promise is resolved with an object containing two properties:
|
* The promise is resolved with an object containing two properties:
|
||||||
*
|
*
|
||||||
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
||||||
* without waiting for the promise to be resolved (or rejected). For this
|
* without waiting for the promise to be resolved (or rejected). For this
|
||||||
* scenario, use `filehandle.createWriteStream()`.
|
* scenario, use `fs.createWriteStream()`.
|
||||||
*
|
*
|
||||||
* On Linux, positional writes do not work when the file is opened in append mode.
|
* On Linux, positional writes do not work when the file is opened in append mode.
|
||||||
* The kernel ignores the position argument and always appends the data to
|
* The kernel ignores the position argument and always appends the data to
|
||||||
* the end of the file.
|
* the end of the file.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @param offset The start position from within `buffer` where the data to write begins.
|
* @param [offset=0] The start position from within `buffer` where the data to write begins.
|
||||||
* @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write.
|
* @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
|
||||||
* @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current
|
* @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
|
||||||
* position. See the POSIX pwrite(2) documentation for more detail.
|
* See the POSIX pwrite(2) documentation for more detail.
|
||||||
*/
|
*/
|
||||||
write<TBuffer extends Uint8Array>(
|
write<TBuffer extends Uint8Array>(
|
||||||
buffer: TBuffer,
|
buffer: TBuffer,
|
||||||
offset?: number | null,
|
offset?: number | null,
|
||||||
length?: number | null,
|
length?: number | null,
|
||||||
position?: number | null,
|
position?: number | null
|
||||||
): Promise<{
|
): Promise<{
|
||||||
bytesWritten: number;
|
bytesWritten: number;
|
||||||
buffer: TBuffer;
|
buffer: TBuffer;
|
||||||
@@ -422,7 +358,7 @@ declare module "fs/promises" {
|
|||||||
write(
|
write(
|
||||||
data: string,
|
data: string,
|
||||||
position?: number | null,
|
position?: number | null,
|
||||||
encoding?: BufferEncoding | null,
|
encoding?: BufferEncoding | null
|
||||||
): Promise<{
|
): Promise<{
|
||||||
bytesWritten: number;
|
bytesWritten: number;
|
||||||
buffer: string;
|
buffer: string;
|
||||||
@@ -439,14 +375,14 @@ declare module "fs/promises" {
|
|||||||
* The kernel ignores the position argument and always appends the data to
|
* The kernel ignores the position argument and always appends the data to
|
||||||
* the end of the file.
|
* the end of the file.
|
||||||
* @since v12.9.0
|
* @since v12.9.0
|
||||||
* @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
* @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
||||||
* position.
|
* position.
|
||||||
*/
|
*/
|
||||||
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
||||||
/**
|
/**
|
||||||
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
||||||
* @since v13.13.0, v12.17.0
|
* @since v13.13.0, v12.17.0
|
||||||
* @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
* @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
||||||
* @return Fulfills upon success an object containing two properties:
|
* @return Fulfills upon success an object containing two properties:
|
||||||
*/
|
*/
|
||||||
readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
||||||
@@ -455,7 +391,7 @@ declare module "fs/promises" {
|
|||||||
* complete.
|
* complete.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { open } from 'node:fs/promises';
|
* import { open } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* let filehandle;
|
* let filehandle;
|
||||||
* try {
|
* try {
|
||||||
@@ -468,19 +404,13 @@ declare module "fs/promises" {
|
|||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
close(): Promise<void>;
|
close(): Promise<void>;
|
||||||
/**
|
|
||||||
* An alias for {@link FileHandle.close()}.
|
|
||||||
* @since v20.4.0
|
|
||||||
*/
|
|
||||||
[Symbol.asyncDispose](): Promise<void>;
|
|
||||||
}
|
}
|
||||||
const constants: typeof fsConstants;
|
|
||||||
/**
|
/**
|
||||||
* Tests a user's permissions for the file or directory specified by `path`.
|
* Tests a user's permissions for the file or directory specified by `path`.
|
||||||
* The `mode` argument is an optional integer that specifies the accessibility
|
* The `mode` argument is an optional integer that specifies the accessibility
|
||||||
* checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
|
* checks to be performed. Check `File access constants` for possible values
|
||||||
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
* of `mode`. It is possible to create a mask consisting of the bitwise OR of
|
||||||
* possible values of `mode`.
|
* two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
|
||||||
*
|
*
|
||||||
* If the accessibility check is successful, the promise is resolved with no
|
* If the accessibility check is successful, the promise is resolved with no
|
||||||
* value. If any of the accessibility checks fail, the promise is rejected
|
* value. If any of the accessibility checks fail, the promise is rejected
|
||||||
@@ -488,7 +418,8 @@ declare module "fs/promises" {
|
|||||||
* written by the current process.
|
* written by the current process.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { access, constants } from 'node:fs/promises';
|
* import { access } from 'fs/promises';
|
||||||
|
* import { constants } from 'fs';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await access('/etc/passwd', constants.R_OK | constants.W_OK);
|
* await access('/etc/passwd', constants.R_OK | constants.W_OK);
|
||||||
@@ -517,13 +448,14 @@ declare module "fs/promises" {
|
|||||||
* will be made to remove the destination.
|
* will be made to remove the destination.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { copyFile, constants } from 'node:fs/promises';
|
* import { constants } from 'fs';
|
||||||
|
* import { copyFile } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await copyFile('source.txt', 'destination.txt');
|
* await copyFile('source.txt', 'destination.txt');
|
||||||
* console.log('source.txt was copied to destination.txt');
|
* console.log('source.txt was copied to destination.txt');
|
||||||
* } catch {
|
* } catch {
|
||||||
* console.error('The file could not be copied');
|
* console.log('The file could not be copied');
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
|
* // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
|
||||||
@@ -531,7 +463,7 @@ declare module "fs/promises" {
|
|||||||
* await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
|
* await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
|
||||||
* console.log('source.txt was copied to destination.txt');
|
* console.log('source.txt was copied to destination.txt');
|
||||||
* } catch {
|
* } catch {
|
||||||
* console.error('The file could not be copied');
|
* console.log('The file could not be copied');
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -555,7 +487,7 @@ declare module "fs/promises" {
|
|||||||
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
||||||
* @return Fulfills with a {FileHandle} object.
|
* @return Fulfills with a {FileHandle} object.
|
||||||
*/
|
*/
|
||||||
function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
|
function open(path: PathLike, flags: string | number, mode?: Mode): Promise<FileHandle>;
|
||||||
/**
|
/**
|
||||||
* Renames `oldPath` to `newPath`.
|
* Renames `oldPath` to `newPath`.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -593,19 +525,6 @@ declare module "fs/promises" {
|
|||||||
* and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory
|
* and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory
|
||||||
* that exists results in a
|
* that exists results in a
|
||||||
* rejection only when `recursive` is false.
|
* rejection only when `recursive` is false.
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import { mkdir } from 'node:fs/promises';
|
|
||||||
*
|
|
||||||
* try {
|
|
||||||
* const projectFolder = new URL('./test/project/', import.meta.url);
|
|
||||||
* const createDir = await mkdir(projectFolder, { recursive: true });
|
|
||||||
*
|
|
||||||
* console.log(`created ${createDir}`);
|
|
||||||
* } catch (err) {
|
|
||||||
* console.error(err.message);
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
|
* @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
|
||||||
*/
|
*/
|
||||||
@@ -613,7 +532,7 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options: MakeDirectoryOptions & {
|
options: MakeDirectoryOptions & {
|
||||||
recursive: true;
|
recursive: true;
|
||||||
},
|
}
|
||||||
): Promise<string | undefined>;
|
): Promise<string | undefined>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous mkdir(2) - create a directory.
|
* Asynchronous mkdir(2) - create a directory.
|
||||||
@@ -626,9 +545,9 @@ declare module "fs/promises" {
|
|||||||
options?:
|
options?:
|
||||||
| Mode
|
| Mode
|
||||||
| (MakeDirectoryOptions & {
|
| (MakeDirectoryOptions & {
|
||||||
recursive?: false | undefined;
|
recursive?: false | undefined;
|
||||||
})
|
})
|
||||||
| null,
|
| null
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous mkdir(2) - create a directory.
|
* Asynchronous mkdir(2) - create a directory.
|
||||||
@@ -648,7 +567,7 @@ declare module "fs/promises" {
|
|||||||
* If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
|
* If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { readdir } from 'node:fs/promises';
|
* import { readdir } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const files = await readdir(path);
|
* const files = await readdir(path);
|
||||||
@@ -665,11 +584,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
withFileTypes?: false | undefined;
|
withFileTypes?: false | undefined;
|
||||||
recursive?: boolean | undefined;
|
})
|
||||||
})
|
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string[]>;
|
): Promise<string[]>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous readdir(3) - read a directory.
|
* Asynchronous readdir(3) - read a directory.
|
||||||
@@ -680,11 +598,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options:
|
options:
|
||||||
| {
|
| {
|
||||||
encoding: "buffer";
|
encoding: 'buffer';
|
||||||
withFileTypes?: false | undefined;
|
withFileTypes?: false | undefined;
|
||||||
recursive?: boolean | undefined;
|
}
|
||||||
}
|
| 'buffer'
|
||||||
| "buffer",
|
|
||||||
): Promise<Buffer[]>;
|
): Promise<Buffer[]>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous readdir(3) - read a directory.
|
* Asynchronous readdir(3) - read a directory.
|
||||||
@@ -695,11 +612,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
withFileTypes?: false | undefined;
|
withFileTypes?: false | undefined;
|
||||||
recursive?: boolean | undefined;
|
})
|
||||||
})
|
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string[] | Buffer[]>;
|
): Promise<string[] | Buffer[]>;
|
||||||
/**
|
/**
|
||||||
* Asynchronous readdir(3) - read a directory.
|
* Asynchronous readdir(3) - read a directory.
|
||||||
@@ -710,8 +626,7 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
options: ObjectEncodingOptions & {
|
options: ObjectEncodingOptions & {
|
||||||
withFileTypes: true;
|
withFileTypes: true;
|
||||||
recursive?: boolean | undefined;
|
}
|
||||||
},
|
|
||||||
): Promise<Dirent[]>;
|
): Promise<Dirent[]>;
|
||||||
/**
|
/**
|
||||||
* Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
|
* Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
|
||||||
@@ -740,14 +655,11 @@ declare module "fs/promises" {
|
|||||||
/**
|
/**
|
||||||
* Creates a symbolic link.
|
* Creates a symbolic link.
|
||||||
*
|
*
|
||||||
* The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will
|
* The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path
|
||||||
* autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not
|
* to be absolute. When using `'junction'`, the `target` argument will
|
||||||
* exist, `'file'` will be used. Windows junction points require the destination
|
* automatically be normalized to absolute path.
|
||||||
* path to be absolute. When using `'junction'`, the `target` argument will
|
|
||||||
* automatically be normalized to absolute path. Junction points on NTFS volumes
|
|
||||||
* can only point to directories.
|
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @param [type='null']
|
* @param [type='file']
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
||||||
@@ -762,13 +674,13 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts?: StatOptions & {
|
opts?: StatOptions & {
|
||||||
bigint?: false | undefined;
|
bigint?: false | undefined;
|
||||||
},
|
}
|
||||||
): Promise<Stats>;
|
): Promise<Stats>;
|
||||||
function lstat(
|
function lstat(
|
||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts: StatOptions & {
|
opts: StatOptions & {
|
||||||
bigint: true;
|
bigint: true;
|
||||||
},
|
}
|
||||||
): Promise<BigIntStats>;
|
): Promise<BigIntStats>;
|
||||||
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||||
/**
|
/**
|
||||||
@@ -779,32 +691,15 @@ declare module "fs/promises" {
|
|||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts?: StatOptions & {
|
opts?: StatOptions & {
|
||||||
bigint?: false | undefined;
|
bigint?: false | undefined;
|
||||||
},
|
}
|
||||||
): Promise<Stats>;
|
): Promise<Stats>;
|
||||||
function stat(
|
function stat(
|
||||||
path: PathLike,
|
path: PathLike,
|
||||||
opts: StatOptions & {
|
opts: StatOptions & {
|
||||||
bigint: true;
|
bigint: true;
|
||||||
},
|
}
|
||||||
): Promise<BigIntStats>;
|
): Promise<BigIntStats>;
|
||||||
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||||
/**
|
|
||||||
* @since v19.6.0, v18.15.0
|
|
||||||
* @return Fulfills with the {fs.StatFs} object for the given `path`.
|
|
||||||
*/
|
|
||||||
function statfs(
|
|
||||||
path: PathLike,
|
|
||||||
opts?: StatFsOptions & {
|
|
||||||
bigint?: false | undefined;
|
|
||||||
},
|
|
||||||
): Promise<StatsFs>;
|
|
||||||
function statfs(
|
|
||||||
path: PathLike,
|
|
||||||
opts: StatFsOptions & {
|
|
||||||
bigint: true;
|
|
||||||
},
|
|
||||||
): Promise<BigIntStatsFs>;
|
|
||||||
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
|
|
||||||
/**
|
/**
|
||||||
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -846,7 +741,7 @@ declare module "fs/promises" {
|
|||||||
* @since v14.5.0, v12.19.0
|
* @since v14.5.0, v12.19.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Changes the ownership of a file.
|
* Changes the ownership of a file.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
@@ -860,11 +755,11 @@ declare module "fs/promises" {
|
|||||||
*
|
*
|
||||||
* * Values can be either numbers representing Unix epoch time, `Date`s, or a
|
* * Values can be either numbers representing Unix epoch time, `Date`s, or a
|
||||||
* numeric string like `'123456789.0'`.
|
* numeric string like `'123456789.0'`.
|
||||||
* * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown.
|
* * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown.
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
||||||
*
|
*
|
||||||
@@ -893,10 +788,7 @@ declare module "fs/promises" {
|
|||||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||||
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
||||||
*/
|
*/
|
||||||
function realpath(
|
function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
||||||
path: PathLike,
|
|
||||||
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
||||||
): Promise<string | Buffer>;
|
|
||||||
/**
|
/**
|
||||||
* Creates a unique temporary directory. A unique directory name is generated by
|
* Creates a unique temporary directory. A unique directory name is generated by
|
||||||
* appending six random characters to the end of the provided `prefix`. Due to
|
* appending six random characters to the end of the provided `prefix`. Due to
|
||||||
@@ -908,12 +800,10 @@ declare module "fs/promises" {
|
|||||||
* object with an `encoding` property specifying the character encoding to use.
|
* object with an `encoding` property specifying the character encoding to use.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { mkdtemp } from 'node:fs/promises';
|
* import { mkdtemp } from 'fs/promises';
|
||||||
* import { join } from 'node:path';
|
|
||||||
* import { tmpdir } from 'node:os';
|
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* await mkdtemp(join(tmpdir(), 'foo-'));
|
* await mkdtemp(path.join(os.tmpdir(), 'foo-'));
|
||||||
* } catch (err) {
|
* } catch (err) {
|
||||||
* console.error(err);
|
* console.error(err);
|
||||||
* }
|
* }
|
||||||
@@ -922,9 +812,9 @@ declare module "fs/promises" {
|
|||||||
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
||||||
* characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
|
* characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
|
||||||
* platform-specific path separator
|
* platform-specific path separator
|
||||||
* (`require('node:path').sep`).
|
* (`require('path').sep`).
|
||||||
* @since v10.0.0
|
* @since v10.0.0
|
||||||
* @return Fulfills with a string containing the file system path of the newly created temporary directory.
|
* @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
|
||||||
*/
|
*/
|
||||||
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
||||||
/**
|
/**
|
||||||
@@ -940,9 +830,7 @@ declare module "fs/promises" {
|
|||||||
*/
|
*/
|
||||||
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property.
|
||||||
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
|
||||||
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
|
||||||
*
|
*
|
||||||
* The `encoding` option is ignored if `data` is a buffer.
|
* The `encoding` option is ignored if `data` is a buffer.
|
||||||
*
|
*
|
||||||
@@ -957,15 +845,15 @@ declare module "fs/promises" {
|
|||||||
*
|
*
|
||||||
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
||||||
* method that performs multiple `write` calls internally to write the buffer
|
* method that performs multiple `write` calls internally to write the buffer
|
||||||
* passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`.
|
* passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
|
||||||
*
|
*
|
||||||
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
||||||
* Cancelation is "best effort", and some amount of data is likely still
|
* Cancelation is "best effort", and some amount of data is likely still
|
||||||
* to be written.
|
* to be written.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { writeFile } from 'node:fs/promises';
|
* import { writeFile } from 'fs/promises';
|
||||||
* import { Buffer } from 'node:buffer';
|
* import { Buffer } from 'buffer';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const controller = new AbortController();
|
* const controller = new AbortController();
|
||||||
@@ -991,19 +879,14 @@ declare module "fs/promises" {
|
|||||||
*/
|
*/
|
||||||
function writeFile(
|
function writeFile(
|
||||||
file: PathLike | FileHandle,
|
file: PathLike | FileHandle,
|
||||||
data:
|
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
|
||||||
| string
|
|
||||||
| NodeJS.ArrayBufferView
|
|
||||||
| Iterable<string | NodeJS.ArrayBufferView>
|
|
||||||
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
|
||||||
| Stream,
|
|
||||||
options?:
|
options?:
|
||||||
| (ObjectEncodingOptions & {
|
| (ObjectEncodingOptions & {
|
||||||
mode?: Mode | undefined;
|
mode?: Mode | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} & Abortable)
|
} & Abortable)
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously append data to a file, creating the file if it does not yet
|
* Asynchronously append data to a file, creating the file if it does not yet
|
||||||
@@ -1019,11 +902,7 @@ declare module "fs/promises" {
|
|||||||
* @param path filename or {FileHandle}
|
* @param path filename or {FileHandle}
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function appendFile(
|
function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
||||||
path: PathLike | FileHandle,
|
|
||||||
data: string | Uint8Array,
|
|
||||||
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
||||||
): Promise<void>;
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
*
|
*
|
||||||
@@ -1037,25 +916,11 @@ declare module "fs/promises" {
|
|||||||
* with an error. On FreeBSD, a representation of the directory's contents will be
|
* with an error. On FreeBSD, a representation of the directory's contents will be
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* An example of reading a `package.json` file located in the same directory of the
|
|
||||||
* running code:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* import { readFile } from 'node:fs/promises';
|
|
||||||
* try {
|
|
||||||
* const filePath = new URL('./package.json', import.meta.url);
|
|
||||||
* const contents = await readFile(filePath, { encoding: 'utf8' });
|
|
||||||
* console.log(contents);
|
|
||||||
* } catch (err) {
|
|
||||||
* console.error(err.message);
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
|
* It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
|
||||||
* request is aborted the promise returned is rejected with an `AbortError`:
|
* request is aborted the promise returned is rejected with an `AbortError`:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { readFile } from 'node:fs/promises';
|
* import { readFile } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const controller = new AbortController();
|
* const controller = new AbortController();
|
||||||
@@ -1084,10 +949,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike | FileHandle,
|
path: PathLike | FileHandle,
|
||||||
options?:
|
options?:
|
||||||
| ({
|
| ({
|
||||||
encoding?: null | undefined;
|
encoding?: null | undefined;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} & Abortable)
|
} & Abortable)
|
||||||
| null,
|
| null
|
||||||
): Promise<Buffer>;
|
): Promise<Buffer>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
@@ -1100,10 +965,10 @@ declare module "fs/promises" {
|
|||||||
path: PathLike | FileHandle,
|
path: PathLike | FileHandle,
|
||||||
options:
|
options:
|
||||||
| ({
|
| ({
|
||||||
encoding: BufferEncoding;
|
encoding: BufferEncoding;
|
||||||
flag?: OpenMode | undefined;
|
flag?: OpenMode | undefined;
|
||||||
} & Abortable)
|
} & Abortable)
|
||||||
| BufferEncoding,
|
| BufferEncoding
|
||||||
): Promise<string>;
|
): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously reads the entire contents of a file.
|
* Asynchronously reads the entire contents of a file.
|
||||||
@@ -1115,15 +980,12 @@ declare module "fs/promises" {
|
|||||||
function readFile(
|
function readFile(
|
||||||
path: PathLike | FileHandle,
|
path: PathLike | FileHandle,
|
||||||
options?:
|
options?:
|
||||||
| (
|
| (ObjectEncodingOptions &
|
||||||
& ObjectEncodingOptions
|
Abortable & {
|
||||||
& Abortable
|
flag?: OpenMode | undefined;
|
||||||
& {
|
})
|
||||||
flag?: OpenMode | undefined;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
| BufferEncoding
|
| BufferEncoding
|
||||||
| null,
|
| null
|
||||||
): Promise<string | Buffer>;
|
): Promise<string | Buffer>;
|
||||||
/**
|
/**
|
||||||
* Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
|
* Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
|
||||||
@@ -1137,7 +999,7 @@ declare module "fs/promises" {
|
|||||||
* Example using async iteration:
|
* Example using async iteration:
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* import { opendir } from 'node:fs/promises';
|
* import { opendir } from 'fs/promises';
|
||||||
*
|
*
|
||||||
* try {
|
* try {
|
||||||
* const dir = await opendir('./');
|
* const dir = await opendir('./');
|
||||||
@@ -1158,7 +1020,7 @@ declare module "fs/promises" {
|
|||||||
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const { watch } = require('node:fs/promises');
|
* const { watch } = require('fs/promises');
|
||||||
*
|
*
|
||||||
* const ac = new AbortController();
|
* const ac = new AbortController();
|
||||||
* const { signal } = ac;
|
* const { signal } = ac;
|
||||||
@@ -1181,16 +1043,16 @@ declare module "fs/promises" {
|
|||||||
* disappears in the directory.
|
* disappears in the directory.
|
||||||
*
|
*
|
||||||
* All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
|
* All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
|
||||||
* @since v15.9.0, v14.18.0
|
* @since v15.9.0
|
||||||
* @return of objects with the properties:
|
* @return of objects with the properties:
|
||||||
*/
|
*/
|
||||||
function watch(
|
function watch(
|
||||||
filename: PathLike,
|
filename: PathLike,
|
||||||
options:
|
options:
|
||||||
| (WatchOptions & {
|
| (WatchOptions & {
|
||||||
encoding: "buffer";
|
encoding: 'buffer';
|
||||||
})
|
})
|
||||||
| "buffer",
|
| 'buffer'
|
||||||
): AsyncIterable<FileChangeInfo<Buffer>>;
|
): AsyncIterable<FileChangeInfo<Buffer>>;
|
||||||
/**
|
/**
|
||||||
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
||||||
@@ -1209,10 +1071,7 @@ declare module "fs/promises" {
|
|||||||
* If `persistent` is not supplied, the default of `true` is used.
|
* If `persistent` is not supplied, the default of `true` is used.
|
||||||
* If `recursive` is not supplied, the default of `false` is used.
|
* If `recursive` is not supplied, the default of `false` is used.
|
||||||
*/
|
*/
|
||||||
function watch(
|
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
||||||
filename: PathLike,
|
|
||||||
options: WatchOptions | string,
|
|
||||||
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
||||||
* including subdirectories and files.
|
* including subdirectories and files.
|
||||||
@@ -1225,8 +1084,8 @@ declare module "fs/promises" {
|
|||||||
* @param dest destination path to copy to.
|
* @param dest destination path to copy to.
|
||||||
* @return Fulfills with `undefined` upon success.
|
* @return Fulfills with `undefined` upon success.
|
||||||
*/
|
*/
|
||||||
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
function cp(source: string, destination: string, opts?: CopyOptions): Promise<void>;
|
||||||
}
|
}
|
||||||
declare module "node:fs/promises" {
|
declare module 'node:fs/promises' {
|
||||||
export * from "fs/promises";
|
export * from 'fs/promises';
|
||||||
}
|
}
|
||||||
|
|||||||
157
node_modules/@types/node/globals.d.ts
generated
vendored
Normal file → Executable file
157
node_modules/@types/node/globals.d.ts
generated
vendored
Normal file → Executable file
@@ -20,9 +20,9 @@ interface ErrorConstructor {
|
|||||||
------------------------------------------------*/
|
------------------------------------------------*/
|
||||||
|
|
||||||
// For backwards compability
|
// For backwards compability
|
||||||
interface NodeRequire extends NodeJS.Require {}
|
interface NodeRequire extends NodeJS.Require { }
|
||||||
interface RequireResolve extends NodeJS.RequireResolve {}
|
interface RequireResolve extends NodeJS.RequireResolve { }
|
||||||
interface NodeModule extends NodeJS.Module {}
|
interface NodeModule extends NodeJS.Module { }
|
||||||
|
|
||||||
declare var process: NodeJS.Process;
|
declare var process: NodeJS.Process;
|
||||||
declare var console: Console;
|
declare var console: Console;
|
||||||
@@ -41,7 +41,7 @@ declare var exports: any;
|
|||||||
*/
|
*/
|
||||||
declare var gc: undefined | (() => void);
|
declare var gc: undefined | (() => void);
|
||||||
|
|
||||||
// #region borrowed
|
//#region borrowed
|
||||||
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
|
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
|
||||||
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
||||||
interface AbortController {
|
interface AbortController {
|
||||||
@@ -53,58 +53,30 @@ interface AbortController {
|
|||||||
/**
|
/**
|
||||||
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
||||||
*/
|
*/
|
||||||
abort(reason?: any): void;
|
abort(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
||||||
interface AbortSignal extends EventTarget {
|
interface AbortSignal {
|
||||||
/**
|
/**
|
||||||
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
||||||
*/
|
*/
|
||||||
readonly aborted: boolean;
|
readonly aborted: boolean;
|
||||||
readonly reason: any;
|
|
||||||
onabort: null | ((this: AbortSignal, event: Event) => any);
|
|
||||||
throwIfAborted(): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
declare var AbortController: {
|
||||||
: {
|
prototype: AbortController;
|
||||||
prototype: AbortController;
|
new(): AbortController;
|
||||||
new(): AbortController;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
declare var AbortSignal: {
|
||||||
: {
|
prototype: AbortSignal;
|
||||||
prototype: AbortSignal;
|
new(): AbortSignal;
|
||||||
new(): AbortSignal;
|
// TODO: Add abort() static
|
||||||
abort(reason?: any): AbortSignal;
|
};
|
||||||
timeout(milliseconds: number): AbortSignal;
|
//#endregion borrowed
|
||||||
};
|
|
||||||
// #endregion borrowed
|
|
||||||
|
|
||||||
// #region Disposable
|
//#region ArrayLike.at()
|
||||||
interface SymbolConstructor {
|
|
||||||
/**
|
|
||||||
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
|
||||||
*/
|
|
||||||
readonly dispose: unique symbol;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
|
||||||
*/
|
|
||||||
readonly asyncDispose: unique symbol;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Disposable {
|
|
||||||
[Symbol.dispose](): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncDisposable {
|
|
||||||
[Symbol.asyncDispose](): PromiseLike<void>;
|
|
||||||
}
|
|
||||||
// #endregion Disposable
|
|
||||||
|
|
||||||
// #region ArrayLike.at()
|
|
||||||
interface RelativeIndexable<T> {
|
interface RelativeIndexable<T> {
|
||||||
/**
|
/**
|
||||||
* Takes an integer value and returns the item at that index,
|
* Takes an integer value and returns the item at that index,
|
||||||
@@ -115,7 +87,6 @@ interface RelativeIndexable<T> {
|
|||||||
}
|
}
|
||||||
interface String extends RelativeIndexable<string> {}
|
interface String extends RelativeIndexable<string> {}
|
||||||
interface Array<T> extends RelativeIndexable<T> {}
|
interface Array<T> extends RelativeIndexable<T> {}
|
||||||
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
||||||
interface Int8Array extends RelativeIndexable<number> {}
|
interface Int8Array extends RelativeIndexable<number> {}
|
||||||
interface Uint8Array extends RelativeIndexable<number> {}
|
interface Uint8Array extends RelativeIndexable<number> {}
|
||||||
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
||||||
@@ -127,17 +98,7 @@ interface Float32Array extends RelativeIndexable<number> {}
|
|||||||
interface Float64Array extends RelativeIndexable<number> {}
|
interface Float64Array extends RelativeIndexable<number> {}
|
||||||
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
||||||
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
||||||
// #endregion ArrayLike.at() end
|
//#endregion ArrayLike.at() end
|
||||||
|
|
||||||
/**
|
|
||||||
* @since v17.0.0
|
|
||||||
*
|
|
||||||
* Creates a deep clone of an object.
|
|
||||||
*/
|
|
||||||
declare function structuredClone<T>(
|
|
||||||
value: T,
|
|
||||||
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
|
||||||
): T;
|
|
||||||
|
|
||||||
/*----------------------------------------------*
|
/*----------------------------------------------*
|
||||||
* *
|
* *
|
||||||
@@ -180,7 +141,7 @@ declare namespace NodeJS {
|
|||||||
/**
|
/**
|
||||||
* Name of the script [if this function was defined in a script]
|
* Name of the script [if this function was defined in a script]
|
||||||
*/
|
*/
|
||||||
getFileName(): string | undefined;
|
getFileName(): string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current line number [if this function was defined in a script]
|
* Current line number [if this function was defined in a script]
|
||||||
@@ -233,7 +194,7 @@ declare namespace NodeJS {
|
|||||||
pause(): this;
|
pause(): this;
|
||||||
resume(): this;
|
resume(): this;
|
||||||
isPaused(): boolean;
|
isPaused(): boolean;
|
||||||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
|
||||||
unpipe(destination?: WritableStream): this;
|
unpipe(destination?: WritableStream): this;
|
||||||
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
||||||
wrap(oldStream: ReadableStream): this;
|
wrap(oldStream: ReadableStream): this;
|
||||||
@@ -244,12 +205,12 @@ declare namespace NodeJS {
|
|||||||
writable: boolean;
|
writable: boolean;
|
||||||
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
||||||
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
||||||
end(cb?: () => void): this;
|
end(cb?: () => void): void;
|
||||||
end(data: string | Uint8Array, cb?: () => void): this;
|
end(data: string | Uint8Array, cb?: () => void): void;
|
||||||
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
end(str: string, encoding?: BufferEncoding, cb?: () => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
interface ReadWriteStream extends ReadableStream, WritableStream { }
|
||||||
|
|
||||||
interface RefCounted {
|
interface RefCounted {
|
||||||
ref(): this;
|
ref(): this;
|
||||||
@@ -282,14 +243,14 @@ declare namespace NodeJS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RequireResolve {
|
interface RequireResolve {
|
||||||
(id: string, options?: { paths?: string[] | undefined }): string;
|
(id: string, options?: { paths?: string[] | undefined; }): string;
|
||||||
paths(request: string): string[] | null;
|
paths(request: string): string[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
|
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
|
||||||
".js": (m: Module, filename: string) => any;
|
'.js': (m: Module, filename: string) => any;
|
||||||
".json": (m: Module, filename: string) => any;
|
'.json': (m: Module, filename: string) => any;
|
||||||
".node": (m: Module, filename: string) => any;
|
'.node': (m: Module, filename: string) => any;
|
||||||
}
|
}
|
||||||
interface Module {
|
interface Module {
|
||||||
/**
|
/**
|
||||||
@@ -301,11 +262,11 @@ declare namespace NodeJS {
|
|||||||
id: string;
|
id: string;
|
||||||
filename: string;
|
filename: string;
|
||||||
loaded: boolean;
|
loaded: boolean;
|
||||||
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
|
/** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */
|
||||||
parent: Module | null | undefined;
|
parent: Module | null | undefined;
|
||||||
children: Module[];
|
children: Module[];
|
||||||
/**
|
/**
|
||||||
* @since v11.14.0
|
* @since 11.14.0
|
||||||
*
|
*
|
||||||
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
||||||
*/
|
*/
|
||||||
@@ -320,62 +281,4 @@ declare namespace NodeJS {
|
|||||||
interface ReadOnlyDict<T> {
|
interface ReadOnlyDict<T> {
|
||||||
readonly [key: string]: T | undefined;
|
readonly [key: string]: T | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace fetch {
|
|
||||||
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
|
|
||||||
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
|
|
||||||
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
|
|
||||||
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
|
|
||||||
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
|
|
||||||
: import("undici-types").RequestInit;
|
|
||||||
type Request = globalThis.Request;
|
|
||||||
type Response = globalThis.Response;
|
|
||||||
type Headers = globalThis.Headers;
|
|
||||||
type FormData = globalThis.FormData;
|
|
||||||
type RequestInit = globalThis.RequestInit;
|
|
||||||
type RequestInfo = import("undici-types").RequestInfo;
|
|
||||||
type HeadersInit = import("undici-types").HeadersInit;
|
|
||||||
type BodyInit = import("undici-types").BodyInit;
|
|
||||||
type RequestRedirect = import("undici-types").RequestRedirect;
|
|
||||||
type RequestCredentials = import("undici-types").RequestCredentials;
|
|
||||||
type RequestMode = import("undici-types").RequestMode;
|
|
||||||
type ReferrerPolicy = import("undici-types").ReferrerPolicy;
|
|
||||||
type Dispatcher = import("undici-types").Dispatcher;
|
|
||||||
type RequestDuplex = import("undici-types").RequestDuplex;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RequestInit extends NodeJS.fetch._RequestInit {}
|
|
||||||
|
|
||||||
declare function fetch(
|
|
||||||
input: NodeJS.fetch.RequestInfo,
|
|
||||||
init?: RequestInit,
|
|
||||||
): Promise<Response>;
|
|
||||||
|
|
||||||
interface Request extends NodeJS.fetch._Request {}
|
|
||||||
declare var Request: typeof globalThis extends {
|
|
||||||
onmessage: any;
|
|
||||||
Request: infer T;
|
|
||||||
} ? T
|
|
||||||
: typeof import("undici-types").Request;
|
|
||||||
|
|
||||||
interface Response extends NodeJS.fetch._Response {}
|
|
||||||
declare var Response: typeof globalThis extends {
|
|
||||||
onmessage: any;
|
|
||||||
Response: infer T;
|
|
||||||
} ? T
|
|
||||||
: typeof import("undici-types").Response;
|
|
||||||
|
|
||||||
interface FormData extends NodeJS.fetch._FormData {}
|
|
||||||
declare var FormData: typeof globalThis extends {
|
|
||||||
onmessage: any;
|
|
||||||
FormData: infer T;
|
|
||||||
} ? T
|
|
||||||
: typeof import("undici-types").FormData;
|
|
||||||
|
|
||||||
interface Headers extends NodeJS.fetch._Headers {}
|
|
||||||
declare var Headers: typeof globalThis extends {
|
|
||||||
onmessage: any;
|
|
||||||
Headers: infer T;
|
|
||||||
} ? T
|
|
||||||
: typeof import("undici-types").Headers;
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user